import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    int mod = (int) 1e9 + 7;
    public void solve(InputReader in, PrintWriter out) {
        int m = in.nextInt();
        int n = in.nextInt();
        long res = 0;
        long a = 0;
        long b = 1;
        int min = Math.min(m,n);
        for (int i = 1; i <= Math.max(m,n); i++) {
            long c = a+b;
            c = mod(c);
            a = b;
            b = c;
            if (min == i) res = b;
        }
        res += b;
        res--;
        res *= 2;
        res = mod(res);
        out.println(res);
    }

    public long mod(long m) {
        if (m >= mod) m %= mod;
        return m;
    }

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Main obj = new Main();
        obj.solve(in, out);
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public float nextFloat() {
            return Float.parseFloat(next());
        }

    }
}

// Why do we fall ? So we can learn to pick ourselves up.
// http://tech-queries.blogspot.com/2011/07/fit-12-dominos-in-2n-strip.html
import java.util.*;
public class solve {
    static int mod = 1000000007;
    public static void main(String[] args) {
        int[] fib = new int[100001];
        fib[1] = 1;
        fib[2] = 2;
        for(int i=3; i<100001; i++) {
            fib[i] = (fib[i - 1] + fib[i - 2])%mod;
        }
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        System.out.println(2L*(fib[n]+fib[m]-1)%mod);
    }
}

// package Quarantine;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class IvanTheFool {
    public static void main(String[] args)throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        int f[]=new int[100001];
        int mod=1000000007;
        f[1]=1;
        f[2]=2;
        for(int i=3;i<=100000;i++){
            f[i]=(f[i-1]+f[i-2])%mod;
        }
        int n=Integer.parseInt(st.nextToken());
        int m=Integer.parseInt(st.nextToken());
        long ans=(0l+f[n]+f[m]-1+mod)%mod;
        ans=(ans*2)%mod;
        System.out.println(ans);
    }
}

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

public class Task1248C {

    public static class FastScanner {

        protected static final int STRBUFFERLENGTH = 0x1000;

        protected DataInputStream dataInputStream;
        protected byte[] buffer = new byte[0x10000];
        protected byte[] strbuffer = new byte[STRBUFFERLENGTH];
        protected int bufferOffset;
        protected int bufferLength;
        protected boolean isEndOfFile;

        public FastScanner() throws IOException {
            dataInputStream = new DataInputStream(System.in);
            Read();
        }

        public FastScanner(final String fileName) throws IOException {
            dataInputStream = new DataInputStream(new FileInputStream(fileName));
            Read();
        }

        protected void Read() throws IOException {
            final int length = dataInputStream.read(buffer);
            if (length > 0) {
                bufferLength = length;
            } else {
                bufferLength = 0;
                isEndOfFile = true;
            }
            bufferOffset = 0;
        }

        protected byte nextByte() throws IOException {
            if (bufferOffset == bufferLength) {
                if (!isEndOfFile) Read();
                if (isEndOfFile) return 0;
            }
            return buffer[bufferOffset++];
        }

        public int nextInt() throws IOException {
            int a = 0;
            boolean isNegative = false;

            byte b = nextByte();
            while (b <= ' ') b = nextByte();
            if (b == '-') {
                isNegative = true;
                b = nextByte();
            }
            while (b > ' ') {
                a = a * 10 + (b - '0');
                b = nextByte();
            }
            return isNegative ? -a : a;
        }

    }

    public static final long MODULUS = 1000000007L;

    public static class Variants {
        public int key;
        public long num;
        public long[][] n = new long[4][4];
    }

    public static HashMap<Integer, Variants> variants = new HashMap<Integer, Variants>();
    public static final Integer[] POW2 = {65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1};
    public static List<Integer> pow2 = Arrays.asList(POW2);

    public static final int B = 0;
    public static final int W = 1;
    public static final int BB = 2;
    public static final int WW = 3;

    static {
        final Variants v = new Variants();
        v.key = 1;
        v.num = 2;
        v.n[B][B] = v.n[W][W] = 1;
        variants.put(1, v);
    }

    public static Variants GetMultiVariants(final Variants v1, final Variants v2) {
        final Variants v = new Variants();
        for (int i1 = 0; i1 < 4; i1++) {
            for (int i2 = 0; i2 < 4; i2++) {
                if (i1 == W && i2 == W) {
                    // стыковка разрешена, но при стыковке справа с единицей получаем WW в конце
                    if (v1.key == 1 && v2.key == 1) {
                        v.n[WW][WW]++;
                    } else if (v2.key == 1) {
                        for (int i = 0; i < 4; i++) v.n[i][WW] += v1.n[i][W];
                    } else {
                        for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) v.n[i][j] += v1.n[i][i1] * v2.n[i2][j];
                    }
                } else if (i1 == B && i2 == B) {
                    // стыковка разрешена, но при стыковке справа с единицей получаем BB в конце
                    if (v1.key == 1 && v2.key == 1) {
                        v.n[BB][BB]++;
                    } else if (v2.key == 1) {
                        for (int i = 0; i < 4; i++) v.n[i][BB] += v1.n[i][B];
                    } else {
                        for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) v.n[i][j] += v1.n[i][i1] * v2.n[i2][j];
                    }
                } else if ((i1 == WW && i2 == W) || (i1 == W && i2 == WW) || (i1 == WW && i2 == WW)
                        || (i1 == B && i2 == BB) || (i1 == BB && i2 == B) || (i1 == BB && i2 == BB)) {
                    // не состыкуются - ничего не деляем
                } else {
                    // состыкуются - обычное суммирование вариантов
                    for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) v.n[i][j] += v1.n[i][i1] * v2.n[i2][j];
                }
            }
        }
        for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) v.n[i][j] %= MODULUS;
        for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) v.num += v.n[i][j];
        v.num %= MODULUS;
        return v;
    }

    public static Variants GetVariants(final int n) {
        if (variants.containsKey(n)) return variants.get(n);
        if (pow2.contains(n)) {
            final Variants v = GetVariants(n/2);
            final Variants v2 = GetMultiVariants(v, v);
            v2.key = n;
            variants.put(n, v2);
            return v2;
        } else {
            Variants v = new Variants();
            boolean firstPower = true;
            for (final int pow : pow2) {
                if ((n & pow) > 0) {
                    if (firstPower) {
                        v = GetVariants(pow);
                        firstPower = false;
                    } else {
                        v = GetMultiVariants(v, GetVariants(pow));
                    }
                }
            }
            return v;
        }
    }

    public static long GetNumVariants(final int N) {
        return GetVariants(N).num;
    }

    public static void main(final String[] args) throws IOException {
        final FastScanner scanner = new FastScanner();

        final int n = scanner.nextInt();
        final int m = scanner.nextInt();

        long numVariants = GetNumVariants(m);
        numVariants += MODULUS - 2;
        numVariants %= MODULUS;

        numVariants += GetNumVariants(n);
        numVariants %= MODULUS;

        System.out.println(numVariants);
    }

}

//package cf594d1;
import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class A {
	static long MOD = 1000000007;
	public static void main(String[] args) {
		MyScanner sc = new MyScanner();
		int n = sc.nextInt(), m = sc.nextInt();
		long[][][] dp = new long[max(n, m)][2][2];
		for(int i = 0; i < 2; i++)
			for(int j = 0; j < 2; j++)
				if(dp.length > 1)
					dp[1][i][j] = 1;
		for(int i = 2; i < dp.length; i++) {
			dp[i][0][0] = dp[i - 1][0][1];
			dp[i][1][1] = dp[i - 1][1][0];
			dp[i][0][1] = (dp[i - 1][1][0] + dp[i - 1][1][1]) % MOD;
			dp[i][1][0] = (dp[i - 1][0][1] + dp[i - 1][0][0]) % MOD;
		}
		long dpN = 0, dpM = 0;
		for(int i = 0; i < 2; i++)
			for(int j = 0; j < 2; j++) {
				dpN = (dpN + dp[n - 1][i][j]) % MOD;
				dpM = (dpM + dp[m - 1][i][j]) % MOD;
			}
		if(n == 1) dpN = 2;
		if(m == 1) dpM = 2;
		out.println((dpN - 2 + dpM + MOD) % MOD);
		out.close();
	}
	static PrintWriter out  = new PrintWriter(new BufferedOutputStream(System.out));
	static class MyScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;
		String next() {
			while (st == null || !st.hasMoreElements())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}

import java.io.*;
import java.util.*;

public class Main {
    static int inf = (int) 1e9 + 7;

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(System.out);
        int n = nextInt();
        int m = nextInt();
        int fib[] = new int [100005];
        fib[0] = 1;
        fib[1] = 1;
        for(int i = 2;i < 100005;i++) fib[i] = (fib[i - 1] + fib[i - 2]) % inf;

        long ans1 = 0;
        for(int i = 0;i < n - 1;i++) {
            ans1 = (ans1 + fib[i]) % inf;
        }
        long ans2 = 0;

        for(int i = 0;i < m - 1;i++) {
            ans2 = (ans2 + fib[i]) % inf;
        }

        long ans3 = (ans1 + ans2 + 1) % inf;
        pw.println(ans3 * 2 % inf);
        pw.close();
    }

    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");
    static PrintWriter pw;

    static String next() throws IOException {
        while (!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

}

import java.io.*;
import java.util.*;

public class Main {

    static FastReader in;
    static PrintWriter out;
    static int N = 100_100;
    static long[] dp;
    static int mod = 1000000007;

    static void solve() {
        int n = in.nextInt();
        int m = in.nextInt();

        dp = new long[N];
        dp[1] = 1;
        dp[2] = 2;
        for (int i = 3; i < N; i++) {
            dp[i] = (dp[i - 2] + dp[i - 1]) % mod;
        }

        long ans = 2 * (dp[n] + dp[m] - 1) % mod;

        out.println(ans);
    }

    public static void main(String[] args) {
        in = new FastReader(System.in);
//        in = new FastReader(new FileInputStream("input.txt"));
        out = new PrintWriter(System.out);
//        out = new PrintWriter(new FileOutputStream("output.txt"));

        int q = 1;

        while (q-- > 0)
            solve();

        out.close();
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        Integer nextInt() {
            return Integer.parseInt(next());
        }

        Long nextLong() {
            return Long.parseLong(next());
        }

        Double nextDouble() {
            return Double.parseDouble(next());
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }
    }
}

import java.io.*;
import java.util.*;

public class Main {

	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	static int oo = (int)1e9;
	static int mod = 1_000_000_007;

	static int[] di = {1, 0, 0, -1};
	static int[] dj = {0, -1, 1, 0};

	static int M = 100005;

	public static void main(String[] args) throws IOException {

		long[][][] dp = new long[M][2][2];
		for(int i = 0; i < 2; ++i) {
			for(int j = 0; j < 2; ++j)
				dp[2][i][j] = 1;
		}
		for(int i = 3; i < M; ++i) {
			for(int j = 0; j < 2; ++j) {
				for(int k = 0; k < 2; ++k) {
					for(int p = 0; p < 2; ++p) {
						if(p == j && j == k)
							continue;
						dp[i][j][k] = (dp[i][j][k] + dp[i-1][p][j]) % mod;
					}
				}
			}
		}

		int n = in.nextInt();
		int m = in.nextInt();
		long x = 0, y = 0;
		if(n == 1)
			x = 2;
		else {
			for(int i = 0; i < 2; ++i) {
				for(int j = 0; j < 2; ++j) {
					x += dp[n][i][j];
				}
			}
			x %= mod;
		}
		if(m == 1)
			y = 2;
		else {
			for(int i = 0; i < 2; ++i) {
				for(int j = 0; j < 2; ++j) {
					y += dp[m][i][j];
				}
			}
			y %= mod;
		}
		long ans = (x + y - 2) % mod;
		System.out.println(ans);

		out.close();
	}

	static boolean inside(int i, int j, int n, int m) {
		return i >= 0 && i < n && j >= 0 && j < m;
	}

	static long pow(long a, long n, long mod) {
		if(n == 0)
			return 1;
		if(n % 2 == 1)
			return a * pow(a, n-1, mod) % mod;
		long x = pow(a, n / 2, mod);
		return x * x % mod;
	}

	static class SegmentTree {
		int n;
		char[] a;
		int[] seg;
		int DEFAULT_VALUE = 0;

		public SegmentTree(char[] a, int n) {
			super();
			this.a = a;
			this.n = n;
			seg = new int[n * 4 + 1];
			build(1, 0, n-1);
		}

		private int build(int node, int i, int j) {
			if(i == j) {
				int x = a[i] - 'a';
				return seg[node] = (1<<x);
			}
			int first = build(node * 2, i, (i+j) / 2);
			int second = build(node * 2 + 1, (i+j) / 2 + 1, j);
			return seg[node] = combine(first, second);
		}

		int update(int k, char value) {
			return update(1, 0, n-1, k, value);
		}

		private int update(int node, int i, int j, int k, char value) {
			if(k < i || k > j)
				return seg[node];
			if(i == j && j == k) {
				a[k] = value;
				int x = a[i] - 'a';
				return seg[node] = (1<<x);
			}
			int m = (i + j) / 2;
			int first = update(node * 2, i, m, k, value);
			int second = update(node * 2 + 1, m + 1, j, k, value);
			return seg[node] = combine(first, second);
		}

		int query(int l, int r) {
			return query(1, 0, n-1, l, r);
		}

		private int query(int node, int i, int j, int l, int r) {
			if(l <= i && j <= r)
				return seg[node];
			if(j < l || i > r)
				return DEFAULT_VALUE;
			int m = (i + j) / 2;
			int first = query(node * 2, i, m, l, r);
			int second = query(node * 2 + 1, m+1, j, l, r);
			return combine(first, second);
		}

		private int combine(int a, int b) {
			return a | b;
		}
	}

	static class DisjointSet {
		int n;
		int[] g;
		int[] h;
		public DisjointSet(int n) {
			super();
			this.n = n;
			g = new int[n];
			h = new int[n];
			for(int i = 0; i < n; ++i) {
				g[i] = i;
				h[i] = 1;
			}
		}
		int find(int x) {
			if(g[x] == x)
				return x;
			return g[x] = find(g[x]);
		}
		void union(int x, int y) {
			x = find(x); y = find(y);
			if(x == y)
				return;
			if(h[x] >= h[y]) {
				g[y] = x;
				if(h[x] == h[y])
					h[x]++;
			}
			else {
				g[x] = y;
			}
		}
	}

	static int[] getPi(char[] a) {
		int m = a.length;
		int j = 0;
		int[] pi = new int[m];
		for(int i = 1; i < m; ++i) {
			while(j > 0 && a[i] != a[j])
				j = pi[j-1];
			if(a[i] == a[j]) {
				pi[i] = j + 1;
				j++;
			}
		}
		return pi;
	}

	static long lcm(long a, long b) {
		return a * b / gcd(a, b);
	}

	static boolean nextPermutation(int[] a) {
		for(int i = a.length - 2; i >= 0; --i) {
			if(a[i] < a[i+1]) {
				for(int j = a.length - 1; ; --j) {
					if(a[i] < a[j]) {
						int t = a[i];
						a[i] = a[j];
						a[j] = t;
						for(i++, j = a.length - 1; i < j; ++i, --j) {
							t = a[i];
							a[i] = a[j];
							a[j] = t;
						}
						return true;
					}
				}
			}
		}
		return false;
	}

	static void shuffle(int[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}

	static void shuffle(long[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			long t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}

	static int lower_bound(int[] a, int n, int k) {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	}
	static int lower_bound(long[] a, int n, long k) {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	}

	static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	static class Pair implements Comparable<Pair> {
		int first, second;

		public Pair(int first, int second) {
			super();
			this.first = first;
			this.second = second;
		}

		@Override
		public int compareTo(Pair o) {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		}

//		@Override
//		public int compareTo(Pair o) {
//			return this.first != o.first ? o.first - this.first : o.second - this.second;
//		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		}
	}
}

class InputReader {

	private final InputStream stream;
	private final byte[] buf = new byte[8192];
	private int curChar, snumChars;

	public InputReader(InputStream st) {
		this.stream = st;
	}

	public int read() {
		if (snumChars == -1)
			throw new InputMismatchException();
		if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int[] nextIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

    int solve(int n, int m) {
        boolean[][] b = new boolean[n][m];
        int ans = 0;
        for (int mask = 0; mask < 1 << (n * m); mask++) {
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    b[i][j] = (mask & (1 << (i * m + j))) > 0;
                }
            }
            boolean ok = true;
            fr:
            for (int x = 0; x < n; x++) {
                for (int y = 0; y < m; y++) {
                    int cnte = 0;
                    for (int d = 0; d < DX.length; d++) {
                        int nx = x + DX[d];
                        int ny = y + DY[d];
                        if (nx >= 0 && nx < n && ny >= 0 && ny < m && b[x][y] == b[nx][ny]) {
                            cnte++;
                        }
                    }
                    if (cnte > 1) {
                        ok = false;
                        break fr;
                    }
                }
            }
            if (ok) {
                ans++;
            }
        }
        return ans;
    }

    int solve2(int n, int m) {
        if (n < m) {
            int tmp = n;
            n = m;
            m = tmp;
        }
        int[] a = new int[Math.max(n, m) + 2];
        a[0] = 2;
        a[1] = 2;
        for (int i = 2; i < a.length; i++) {
            a[i] = (a[i - 1] + a[i - 2]) % MOD;
        }
        int res = a[n];
        for (int i = 0; i < m - 1; i++ ) {
            res = (res + a[i]) % MOD;
        }
        return res;
    }

    int[] DX = {-1, 0, 1, 0};
    int[] DY = {0, -1, 0, 1};
    int MOD = 1_000_000_007;

    void solve() throws IOException {
//        vis();
        int n = nextInt();
        int m = nextInt();
        out.println(solve2(n, m));
    }

    private void vis() {
        for (int n = 1; n < 10; n++) {
            for (int m = 1; m < 10; m++) {
                if (n * m > 25) {
                    continue;
                }
                System.err.print(solve(n, m));
                if (solve(n, m) != solve2(n, m)) {
//                    throw  new AssertionError(n + " " + m + " " +solve(n, m) + " " + solve2(n, m));
                    System.err.print("("+solve2(n, m)+")");
                }
                System.err.print("\t");
            }
            System.err.println();
        }
    }

    String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    StringTokenizer st;
    BufferedReader br;
    PrintWriter out;

    void run() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        long time = System.currentTimeMillis();
        solve();
        System.err.println("time = " + (System.currentTimeMillis() - time));
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new A().run();
    }

}

import java.io.*;
import java.util.*;
public final class code
{
	static final long mod=(long)(1e9+7);
	static long f[];
	static void solve()throws IOException
	{
		f=new long[(int)(1e5+1)];
		long a=1,b=1;
		for(int i=1;i<=(int)(1e5);i++)
		{
			f[i]=b;
			long c=(a+b)%mod;
			a=b;
			b=c;
		}
		int n=nextInt();
		int m=nextInt();
		long ans=((((f[n]+f[m])%mod-1+mod)%mod)*2)%mod;
		out.println(ans);
	}

	///////////////////////////////////////////////////////////
	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;
	static String nextToken()throws IOException
	{
		while(st==null || !st.hasMoreTokens())
			st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	static String nextLine()throws IOException
	{
		return br.readLine();
	}
	static int nextInt()throws IOException
	{
		return Integer.parseInt(nextToken());
	}
	static long nextLong()throws IOException
	{
		return Long.parseLong(nextToken());
	}
	static double nextDouble()throws IOException
	{
		return Double.parseDouble(nextToken());
	}
	public static void main(String args[])throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		out=new PrintWriter(new BufferedOutputStream(System.out));
		solve();
		out.close();
	}
}

import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();

    }

    static int INF = (int)1e9;
    static int maxn = (int)1e5+5;
    static int mod= 1000000007 ;
    static int n,m,k,t,q,d,cnt=2;

    void solve(PrintWriter out, Reader in) throws IOException{
        n = in.nextInt();
        m = in.nextInt();
        int max = Math.max(n,m);
        long ans = 0;

        long[][] dp = new long[max+1][2];

        dp[0][0] = 1;
        dp[0][1] = 1;
        dp[1][0] = 2;
        dp[1][1] = 2;
        for(int i=2;i<max;i++){
            dp[i][0] = (dp[i-1][1]+dp[i-2][1])%mod;
            dp[i][1] = (dp[i-1][0]+dp[i-2][0])%mod;
        }

        ans = (dp[n-1][0]+dp[n-1][1])%mod;
        ans = (ans+dp[m-1][0]+dp[m-1][1])%mod;
        ans = (ans-2+mod)%mod;
        out.println(ans);

    }

    //<>

    static class Reader {

    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public Reader() {
        this(System.in);
    }

    public Reader(InputStream is) {
        mIs = is;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class Pair<A, B> {
	A first;
	B second;

	Pair(A first, B second) {
		this.first = first;
		this.second = second;
	}

}

class TaskB {
	long INF = (long) 1e18 + 5;
	long mod = (long) 1e9 + 7;

	public void solve(int testNumber, InputReader in, PrintWriter pw) {
		int N = in.nextInt();
		int M = in.nextInt();
		long ans = (2 * ((fib(N) + fib(M)) - 1)) % mod;
		pw.println(ans);
//
//		for (int i = 0; i < N; i++) {
//			pw.println(Arrays.toString(dp[i]));
//		}
	}

	long fib(int N) {
		long fib[] = new long[N + 1];
		fib[0] = 1;
		fib[1] = 1;
		for (int i = 2; i <= N; i++) {
			fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
		}
		return fib[N] % mod;
	}

	long sum(int i, int j, long arr[]) {
		long sum = 0;
		for (int k = i; k <= j; k++) {
			sum += arr[k];
		}
		return sum;
	}

	boolean FirstRow_Col(Pair<Integer, Integer> pair) {
		return pair.first == 0 || pair.second == 0;
	}

	int __gcd(int a, int b) {
		if (b == 0)
			return a;
		return __gcd(b, a % b);

	}

	public int getInt(int num) {
		int ret = -1;
		switch (num) {
		case 0:
			ret = 6;
			break;
		case 1:
			ret = 2;
			break;
		case 2:
			ret = 5;
			break;
		case 3:
			ret = 5;
			break;
		case 4:
			ret = 4;
			break;
		case 5:
			ret = 5;
			break;
		case 6:
			ret = 6;
			break;
		case 7:
			ret = 3;
			break;
		case 8:
			ret = 7;
			break;
		case 9:
			ret = 6;
			break;
		}
		return ret;
	}

	public int isPow(long num) {
		int count = 0;
		while (num > 0) {
			num /= 2;
			count++;
		}
		return count;
	}
}

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

//package CodeforcesProject;

import java.io.*;
import java.lang.*;
import java.util.*;

public class Main extends IO {

    public static void main(String[] args) throws Exception {
        long[] quantity = readArrayLong(" ");
        long[] base = new long[(int) (Math.max(quantity[0], quantity[1]) + 1)];
        base[0] = 1;
        base[1] = 1;
        for (int i = 2; i < base.length; i++){
            base[i] = (long) ((base[i - 2] + base[i - 1]) % (1e9 + 7));
        }
        System.out.print(2 * (base[(int) quantity[0]] + base[(int) quantity[1]] - 1) % (1000000000 + 7));
    }

}

class math {

    protected static int gcd(int a, int b) { // NOD
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static float gcd(float a, float b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static double gcd(double a, double b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static double lcm(double a, double b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static float lcm(float a, float b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static int lcm(int a, int b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static long lcm(long a, long b) {
        return a / gcd(a, b) * b;

    }
}

class Division<T extends Number> extends Pair {

    private Division(T dividend, T divider) {
        super(dividend, divider);
        reduce();
    }

    protected static <T extends Number> Division<T> createDivision(T dividend, T divider) {
        return new Division<>(dividend, divider);
    }

    protected void reduce() {
        if (getFirstElement() instanceof Integer) {
            Integer Dividend = (Integer) getFirstElement();
            Integer Divider = (Integer) getSecondElement();
            int gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Long) {
            Long Dividend = (Long) getFirstElement();
            Long Divider = (Long) getSecondElement();
            long gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Float) {
            Float Dividend = (Float) getFirstElement();
            Float Divider = (Float) getSecondElement();
            float gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Double) {
            Double Dividend = (Double) getFirstElement();
            Double Divider = (Double) getSecondElement();
            double gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        }
    }

    protected void addWithoutReturn(Division number) throws UnsupportedOperationException {
        add(number, 0);
    }

    private Division add(Division number, int function) throws UnsupportedOperationException {
        if (getFirstElement() instanceof Integer && number.getFirstElement() instanceof Integer) {
            Integer Dividend = (Integer) getFirstElement();
            Integer Divider = (Integer) getSecondElement();
            Integer Dividend1 = (Integer) number.getFirstElement();
            Integer Divider1 = (Integer) number.getSecondElement();
            Integer lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;

        } else if (getFirstElement() instanceof Long && number.getFirstElement() instanceof Long) {
            Long Dividend = (Long) getFirstElement();
            Long Divider = (Long) getSecondElement();
            Long Dividend1 = (Long) number.getFirstElement();
            Long Divider1 = (Long) number.getSecondElement();
            Long lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else if (getFirstElement() instanceof Float && number.getFirstElement() instanceof Float) {
            Float Dividend = (Float) getFirstElement();
            Float Divider = (Float) getSecondElement();
            Float Dividend1 = (Float) number.getFirstElement();
            Float Divider1 = (Float) number.getSecondElement();
            Float lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else if (getFirstElement() instanceof Double && number.getFirstElement() instanceof Double) {
            Double Dividend = (Double) getFirstElement();
            Double Divider = (Double) getSecondElement();
            Double Dividend1 = (Double) number.getFirstElement();
            Double Divider1 = (Double) number.getSecondElement();
            Double lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else {
            throw new UnsupportedOperationException();
        }
    }

    protected Division addWithReturn(Division number) {
        return add(number, 1);
    }

    protected void multiplyWithoutReturn(Division number) throws UnsupportedOperationException {
        multiply(number, 0);
    }

    protected Division multiplyWithReturn(Division number) throws UnsupportedOperationException {
        return multiply(number, 1);
    }

    private Division multiply(Division number, int function) throws UnsupportedOperationException {
        if (getFirstElement() instanceof Integer && number.getFirstElement() instanceof Integer) {
            Integer first = (Integer) getFirstElement() * (Integer) number.getFirstElement();
            Integer second = (Integer) getSecondElement() * (Integer) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else if (getFirstElement() instanceof Long && number.getFirstElement() instanceof Long) {
            Long first = (Long) getFirstElement() * (Long) number.getFirstElement();
            Long second = (Long) getSecondElement() * (Long) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;

        } else if (getFirstElement() instanceof Float && number.getFirstElement() instanceof Float) {
            Float first = (Float) getFirstElement() * (Float) number.getFirstElement();
            Float second = (Float) getSecondElement() * (Float) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else if (getFirstElement() instanceof Double && number.getFirstElement() instanceof Double) {
            Double first = (Double) getFirstElement() * (Double) number.getFirstElement();
            Double second = (Double) getSecondElement() * (Double) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else {
            throw new UnsupportedOperationException();
        }
    }
}

class Pair<T, T1> {

    private T first;
    private T1 second;

    Pair(T obj, T1 obj1) {
        first = obj;
        second = obj1;
    }

    protected static <T, T1> Pair<T, T1> createPair(T element, T1 element1) {
        return new Pair<>(element, element1);
    }

    protected T getFirstElement() {
        return first;
    }

    protected T1 getSecondElement() {
        return second;
    }

    protected void setFirst(T element) {
        first = element;
    }

    protected void setSecond(T1 element) {
        second = element;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Pair)) {
            return false;
        }
        Pair pair = (Pair) obj;
        return first == pair.first && second == pair.second;
    }

    @Override
    public int hashCode() {
        return 1;
    }
}

class Graph {

    private int[][] base;
    private boolean[] used;
    private int quantity;
    private Integer[] ancestor;

    public int[][] getBase() {
        return base.clone();
    }

    public boolean[] getUsed() {
        return used.clone();
    }

    public int getQuantity() {
        return quantity;
    }

    public Integer[] getAncestor() {
        return ancestor.clone();
    }

    public void start(int length) {
        used = new boolean[length];
        ancestor = new Integer[length];
        ancestor[0] = -1;
        quantity = 0;
    }

    public void ribMatrixToDefault(int length, int quantity, boolean readConsole, int[][] value) throws Exception {
        base = new int[length][];
        List<ArrayList<Integer>> inputBase = new ArrayList<>();
        for (int i = 0; i < length; i++) {
            inputBase.add(new ArrayList<>());
        }
        for (int i = 0; i < quantity; i++) {
            int[] input = readConsole ? IO.readArrayInt(" ") : value[i];
            inputBase.get(input[0] - 1).add(input[1] - 1);
            //inputBase.get(input[0] - 1).add(input[2]); // price
            inputBase.get(input[1] - 1).add(input[0] - 1);
            //inputBase.get(input[1] - 1).add(input[2]); // price
        }
        for (int i = 0; i < length; i++) {
            base[i] = inputBase.get(i).stream().mapToInt(Integer::intValue).toArray();
        }
        start(length);
    }

    public void adjacencyMatrixToDefault(int length, int not, boolean readConsole, int[][] value) throws Exception {
        base = new int[length][];
        List<Integer> buffer = new ArrayList<>();
        int[] InputArray;
        for (int i = 0; i < length; i++) {
            InputArray = readConsole ? IO.readArrayInt(" ") : value[i];
            for (int index = 0; index < length; index++) {
                if (i != index && InputArray[index] != not) {
                    buffer.add(index);
                    // buffer.add(InputArray[index]); // price
                }
            }
            base[i] = buffer.stream().mapToInt(Integer::intValue).toArray();
            buffer.clear();
        }
        start(length);
    }

    public void dfs(int position) throws Exception {
        used[position] = true;
        quantity++;
        int next;
        for (int index = 0; index < base[position].length; index += 2) {
            next = base[position][index];
            if (!used[next]) {
                ancestor[next] = position;
                dfs(next);
            } else {
                if (next != ancestor[position]) { // if cycle
                    throw new Exception();
                }
            }
        }
    }

    public int dijkstra(int start, int stop, int size) {
        start--;
        stop--;
        int[] dist = new int[size];
        for (int i = 0; i < size; i++) {
            if (i != start) {
                dist[i] = Integer.MAX_VALUE;
            }
            ancestor[i] = start;
        }

        Queue<int[]> queue = new PriorityQueue<>(Comparator.comparingInt((int[] ints) -> ints[1]));
        queue.add(new int[]{start, 0});
        int position;
        int[] getQueue;
        while (queue.size() != 0) {
            getQueue = queue.poll();
            position = getQueue[0];
            if (getQueue[1] > dist[position]) {
                continue;
            }
            for (int index = 0; index < base[position].length; index += 2) {
                if (dist[position] + base[position][index + 1] < dist[base[position][index]] && !used[base[position][index]]) {
                    dist[base[position][index]] = dist[position] + base[position][index + 1];
                    ancestor[base[position][index]] = position;
                    queue.add(new int[]{base[position][index], dist[base[position][index]]});
                }
            }
            used[position] = true;
        }
        return dist[stop] == Integer.MAX_VALUE ? -1 : dist[stop];
    }

    public static boolean floydWarshall(int[][] base, int length, int not) {
        for (int k = 0; k < length; k++) {
            for (int i = 0; i < length; i++) {
                for (int j = 0; j < length; j++) {
                    if (base[i][k] == not || base[k][j] == not) {
                        continue;
                    }
                    int total = base[i][k] + base[k][j];
                    if (base[i][j] != not) {
                        base[i][j] = Math.min(base[i][j], total);
                    } else {
                        base[i][j] = total;
                    }
                }
            }
        }
        for (int index = 0; index < length; index++) {
            if (base[index][index] != 0) { // if cycle
                return false;
            }
        }
        return true;
    }
}

interface Array {
    void useArray(int[] a);
}

interface Method {
    void use();
}

class FastSort {

    protected static void sortWithoutReturn(int[] array, int length, int ShellHeapMergeMyInsertionSort) {
        sort(array, ShellHeapMergeMyInsertionSort, length);
    }

    protected static int[] sortWithReturn(int[] array, int length, int ShellHeapMergeMyInsertionSort) {
        int[] base = array.clone();
        sort(base, ShellHeapMergeMyInsertionSort, length);
        return base;
    }

    private static void sort(int[] array, int ShellHeapMergeMyInsertionSort, int length) {
        if (ShellHeapMergeMyInsertionSort < 0 || ShellHeapMergeMyInsertionSort > 4) {
            Random random = new Random();
            ShellHeapMergeMyInsertionSort = random.nextInt(4);
        }
        if (ShellHeapMergeMyInsertionSort == 0) {
            ShellSort(array);
        } else if (ShellHeapMergeMyInsertionSort == 1) {
            HeapSort(array);
        } else if (ShellHeapMergeMyInsertionSort == 2) {
            MergeSort(array, 0, length - 1);
        } else if (ShellHeapMergeMyInsertionSort == 3) {
            straightMergeSort(array, length);
        } else if (ShellHeapMergeMyInsertionSort == 4) {
            insertionSort(array);
        }
    }

    private static void straightMergeSort(int[] array, int size) {
        if (size == 0) {
            return;
        }
        int length = (size / 2) + ((size % 2) == 0 ? 0 : 1);
        Integer[][] ZeroBuffer = new Integer[length + length % 2][2];
        Integer[][] FirstBuffer = new Integer[0][0];
        for (int index = 0; index < length; index++) {
            int ArrayIndex = index * 2;
            int NextArrayIndex = index * 2 + 1;
            if (NextArrayIndex < size) {
                if (array[ArrayIndex] > array[NextArrayIndex]) {
                    ZeroBuffer[index][0] = array[NextArrayIndex];
                    ZeroBuffer[index][1] = array[ArrayIndex];
                } else {
                    ZeroBuffer[index][0] = array[ArrayIndex];
                    ZeroBuffer[index][1] = array[NextArrayIndex];
                }
            } else {
                ZeroBuffer[index][0] = array[ArrayIndex];
            }
        }
        boolean position = false;
        int pointer0, pointer, pointer1, number = 4, NewPointer, count;
        Integer[][] NewBuffer;
        Integer[][] OldBuffer;
        length = (size / 4) + ((size % 4) == 0 ? 0 : 1);
        while (true) {
            pointer0 = 0;
            count = (number / 2) - 1;
            if (!position) {
                FirstBuffer = new Integer[length + length % 2][number];
                NewBuffer = FirstBuffer;
                OldBuffer = ZeroBuffer;
            } else {
                ZeroBuffer = new Integer[length + length % 2][number];
                NewBuffer = ZeroBuffer;
                OldBuffer = FirstBuffer;
            }
            for (int i = 0; i < length; i++) {
                pointer = 0;
                pointer1 = 0;
                NewPointer = pointer0 + 1;
                if (length == 1) {
                    for (int g = 0; g < size; g++) {
                        if (pointer > count || OldBuffer[pointer0][pointer] == null) {
                            array[g] = OldBuffer[NewPointer][pointer1];
                            pointer1++;
                        } else if (pointer1 > count || OldBuffer[NewPointer][pointer1] == null) {
                            if (OldBuffer[pointer0][pointer] == null) {
                                continue;
                            }
                            array[g] = OldBuffer[pointer0][pointer];
                            pointer++;
                        } else if (OldBuffer[pointer0][pointer] >= OldBuffer[NewPointer][pointer1]) {
                            array[g] = OldBuffer[NewPointer][pointer1];
                            pointer1++;
                        } else {
                            array[g] = OldBuffer[pointer0][pointer];
                            pointer++;
                        }
                    }
                    return;
                }
                for (int g = 0; g < number; g++) {
                    if (pointer > count || OldBuffer[pointer0][pointer] == null) {
                        if (OldBuffer[NewPointer][pointer1] == null) {
                            continue;
                        }
                        NewBuffer[i][g] = OldBuffer[NewPointer][pointer1];
                        pointer1++;
                    } else if (pointer1 > count || OldBuffer[NewPointer][pointer1] == null) {
                        if (OldBuffer[pointer0][pointer] == null) {
                            continue;
                        }
                        NewBuffer[i][g] = OldBuffer[pointer0][pointer];
                        pointer++;
                    } else if (OldBuffer[pointer0][pointer] >= OldBuffer[NewPointer][pointer1]) {
                        NewBuffer[i][g] = OldBuffer[NewPointer][pointer1];
                        pointer1++;
                    } else {
                        NewBuffer[i][g] = OldBuffer[pointer0][pointer];
                        pointer++;
                    }
                }
                pointer0 += 2;
            }
            position = !position;
            length = length / 2 + length % 2;
            number *= 2;
        }
    }

    private static void ShellSort(int[] array) {
        int j;
        for (int gap = array.length / 2; gap > 0; gap /= 2) {
            for (int i = gap; i < array.length; i++) {
                int temp = array[i];
                for (j = i; j >= gap && array[j - gap] > temp; j -= gap) {
                    array[j] = array[j - gap];
                }
                array[j] = temp;
            }
        }
    }

    private static void HeapSort(int[] array) {
        for (int i = array.length / 2 - 1; i >= 0; i--)
            shiftDown(array, i, array.length);
        for (int i = array.length - 1; i > 0; i--) {
            swap(array, 0, i);
            shiftDown(array, 0, i);
        }
    }

    private static void shiftDown(int[] array, int i, int n) {
        int child;
        int tmp;
        for (tmp = array[i]; leftChild(i) < n; i = child) {
            child = leftChild(i);
            if (child != n - 1 && (array[child] < array[child + 1]))
                child++;
            if (tmp < array[child])
                array[i] = array[child];
            else
                break;
        }
        array[i] = tmp;
    }

    private static int leftChild(int i) {
        return 2 * i + 1;
    }

    private static void swap(int[] array, int i, int j) {
        int temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }

    private static void MergeSort(int[] array, int low, int high) {
        if (low < high) {
            int mid = (low + high) / 2;
            MergeSort(array, low, mid);
            MergeSort(array, mid + 1, high);
            merge(array, low, mid, high);
        }
    }

    private static void merge(int[] array, int low, int mid, int high) {
        int n = high - low + 1;
        int[] Temp = new int[n];
        int i = low, j = mid + 1;
        int k = 0;
        while (i <= mid || j <= high) {
            if (i > mid)
                Temp[k++] = array[j++];
            else if (j > high)
                Temp[k++] = array[i++];
            else if (array[i] < array[j])
                Temp[k++] = array[i++];
            else
                Temp[k++] = array[j++];
        }
        for (j = 0; j < n; j++)
            array[low + j] = Temp[j];
    }

    private static void insertionSort(int[] elements) {
        for (int i = 1; i < elements.length; i++) {
            int key = elements[i];
            int j = i - 1;
            while (j >= 0 && key < elements[j]) {
                elements[j + 1] = elements[j];
                j--;
            }
            elements[j + 1] = key;
        }
    }
}

class IO {

    private static BufferedReader read;
    private static boolean fileInput = false;
    private static BufferedWriter write;
    private static boolean fileOutput = false;

    public static void setFileInput(boolean fileInput) {
        IO.fileInput = fileInput;
    }

    public static void setFileOutput(boolean fileOutput) {
        IO.fileOutput = fileOutput;
    }

    private static void startInput() {
        try {
            read = new BufferedReader(fileInput ? new FileReader("input.txt") : new InputStreamReader(System.in));
        } catch (Exception error) {
        }
    }

    private static void startOutput() {
        try {
            write = new BufferedWriter(fileOutput ? new FileWriter("output.txt") : new OutputStreamWriter(System.out));
        } catch (Exception error) {
        }
    }

    protected static int readInt() throws Exception {
        if (read == null) {
            startInput();
        }
        return Integer.parseInt(read.readLine());
    }

    protected static long readLong() throws Exception {
        if (read == null) {
            startInput();
        }
        return Long.parseLong(read.readLine());
    }

    protected static String readString() throws Exception {
        if (read == null) {
            startInput();
        }
        return read.readLine();
    }

    protected static int[] readArrayInt(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return Arrays.stream(read.readLine().split(split)).mapToInt(Integer::parseInt).toArray();
    }

    protected static long[] readArrayLong(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return Arrays.stream(read.readLine().split(split)).mapToLong(Long::parseLong).toArray();
    }

    protected static String[] readArrayString(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return read.readLine().split(split);
    }

    protected static void writeArray(int[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Integer.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(Integer[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Integer.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(long[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Long.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(Long[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Long.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    public static void writeArray(String[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(array[index]);
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception ignored) {
        }
    }

    protected static void writeArray(boolean[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Boolean.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception ignored) {
        }
    }

    protected static void writeInt(int number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Integer.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeInt(Integer number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Integer.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeLong(long number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Long.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeLong(Long number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Long.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeString(String word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeBoolean(boolean value, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(value ? "true" : "false");
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeBoolean(Boolean value, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(value ? "true" : "false");
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeChar(char word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeChar(Character word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeEnter() {
        if (write == null) {
            startOutput();
        }
        try {
            write.newLine();
        } catch (Exception ignored) {
        }
    }

    protected static void print(boolean exit) throws Exception {
        if (exit) {
            print();
        } else {
            write.flush();
        }
    }

    protected static void print() throws Exception {
        if (write == null) {
            return;
        }
        write.flush();
        read.close();
        write.close();
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class AAAB {

    static int mod=1000000007;

    void run()throws Exception{
        FastReader scan = new FastReader();
        int n=scan.nextInt();
        int m=scan.nextInt();

        long[] fibo = new long[1000050];
        fibo[0]=1;
        fibo[1]=1;
        for (int i=2;i<1000050;i++) fibo[i]=(fibo[i-1]+fibo[i-2])%mod;

        System.out.println((mod+fibo[n]+fibo[m]-1)*2 %mod);

    }

    public static void main(String[] args) throws Exception {
        new AAAB().run();
    }
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.io.*;
import java.util.*;
import java.math.*;

public class p1248C {

	public void realMain() throws Exception {

		BufferedReader fin = new BufferedReader(new InputStreamReader(System.in), 1000000);

		String in = fin.readLine();

		String[] ar = in.split(" ");

		int n = Integer.parseInt(ar[0]);
		int m = Integer.parseInt(ar[1]);

		BigInteger two = new BigInteger("2");

		BigInteger l = new BigInteger("2");
		BigInteger r = new BigInteger("4");

		int cnt = 2;

		BigInteger nval = BigInteger.ZERO;
		BigInteger mval = BigInteger.ZERO;

		if(n == 1) {
			nval = l;
		} else if(n == 2) {
			nval = r;
		}

		if(m == 1) {
			mval = l;
		} else if(m == 2) {
			mval = r;
		}

		if(!nval.equals(BigInteger.ZERO) && !mval.equals(BigInteger.ZERO)) {
			System.out.println(nval.add(mval).subtract(two));
			return;
		}

		while(cnt <= Math.max(n, m)) {
			BigInteger tmp = l.add(r);
			l = r;
			r = tmp;
			cnt++;

			if(cnt == n) {
				nval = r;
			}
			if(cnt == m) {
				mval = r;
			}
		}

		System.out.println(nval.add(mval).subtract(two).mod(new BigInteger("1000000007")));
		return;

	}

	public static void main(String[] args) throws Exception {
		p1248C a = new p1248C();
		a.realMain();
	}
}

import java.io.*;
import java.util.StringTokenizer;
public class CF1239A {
    static int MOD=1000000007;
    public static void main(String[] args) throws IOException {
         long[] fib=new long[1000001];
         fib[0]=0;
         fib[1]=1;
         fib[2]=1;
         for (int i = 3; i < 1000001; i++) {
            fib[i]=(fib[i-1]+fib[i-2])%MOD;
        }
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());

        int M=Integer.parseInt(st.nextToken());
        int N=Integer.parseInt(st.nextToken());
        int ans=0;
        for (int i = 1; i < M; i++) {
            ans+=fib[i]; ans%=MOD;
        }
        for (int i = 1; i < N; i++) {
            ans+=fib[i]; ans%=MOD;
        }
        ans*=2; ans%=MOD; ans+=2; ans%=MOD;
        System.out.println(ans);
    }

}

import java.io.*;
import java.util.*;

public class Main {
    static long mod = (long)1e9 + 7;
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        // FastScanner in = new FastScanner("search.in");
        //PrintWriter out = new PrintWriter("search.out");
        int n = in.nextInt();
        int m = in.nextInt();
        long dp1[] = new long[Math.max(n,m)];
        long dp2[] = new long[Math.max(n,m)];
        long dp3[] = new long[Math.max(n,m)];
        long dp4[] = new long[Math.max(n,m)];
        dp2[0] = 1;
        for (int i = 1; i < m; i++) {
            dp1[i] = dp2[i-1];
            dp2[i] = dp1[i-1] + dp2[i-1];
            dp2[i]%=mod;
            dp1[i]%=mod;
        }
        dp4[0] = 2;
        for (int i = 1; i < n; i++) {
            dp3[i] = dp4[i-1];
            dp4[i] = dp4[i-1] + dp3[i-1];
            dp3[i]%=mod;
            dp4[i]%=mod;
        }
        out.println((dp3[n-1]%mod + dp4[n-1]%mod + (2 * (dp1[m-1] + dp2[m-1] - 1)%mod)%mod)%mod);
        out.close();
    }
}

class FastScanner {
    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");

    public FastScanner(InputStream s) {
        br = new BufferedReader(new InputStreamReader(s));
    }

    public FastScanner(String s) throws FileNotFoundException {
        br = new BufferedReader(new FileReader(new File(s)));
    }

    public String next() throws IOException {
        if (!st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
}

class point {
    int x, y;

    public point(int x, int y) {
        this.x = x;
        this.y = y;
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AIvanTheFoolAndTheProbabilityTheory solver = new AIvanTheFoolAndTheProbabilityTheory();
        solver.solve(1, in, out);
        out.close();
    }

    static class AIvanTheFoolAndTheProbabilityTheory {
        static NumberTheory.Mod107 mod = new NumberTheory.Mod107();

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            long answer = solve(n, m);
            out.println(answer);
        }

        private static long solve(int n, int m) {
            return mod.mult(2, mod.subtract(mod.add(fib(n), fib(m)), 1));
        }

        private static long fib(int n) {
            long[] fib = new long[n + 1];
            fib[0] = 1;
            fib[1] = 1;

            for (int i = 2; i <= n; i++) {
                fib[i] = mod.add(fib[i - 1], fib[i - 2]);
            }

            return fib[n];
        }

    }

    static class NumberTheory {
        public abstract static class Modulus<M extends NumberTheory.Modulus<M>> {
            ArrayList<Long> factorial = new ArrayList<>();
            ArrayList<Long> invFactorial = new ArrayList<>();

            public abstract long modulus();

            public Modulus() {
                super();
                factorial.add(1L);
                invFactorial.add(1L);
            }

            public long normalize(long x) {
                x %= modulus();
                if (x < 0)
                    x += modulus();
                return x;
            }

            public long add(long a, long b) {
                return normalize(a + b);
            }

            public long subtract(long a, long b) {
                return normalize(a - b);
            }

            public long mult(long a, long b) {
                return normalize(a * b);
            }

        }

        public static class Mod107 extends NumberTheory.Modulus<NumberTheory.Mod107> {
            public long modulus() {
                return 1_000_000_007L;
            }

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.util.*;
import java.io.*;

public class Solution{

	public static Integer INT(String s) {
		return Integer.parseInt(s);
	}
	public static Long LONG(String s) {
		return Long.parseLong(s);
	}

	static int mod=1_000_000_007, oo=Integer.MAX_VALUE, _oo=Integer.MAX_VALUE;

	//==================================================================================================================================================

	public static void main(String args[]) throws IOException {

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));	Scanner in=new Scanner(System.in); StringBuilder out=new StringBuilder();

		int r=in.nextInt(),
			c=in.nextInt();

		int same, diff, temp;

		System.out.println((solve(r)+solve(c)-2)%mod);
	}

	public static int solve(int n) {
		int same=0, diff=2;
		for(int i=1; i<n; i++) {
			int temp=same;
			same=diff;
			diff=(diff+temp)%mod;
		}

		return (same+diff)%mod;
	}
}

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    static final int mod = (int) (1e9 + 7), UNCALC = -1;
    static int n;
    static int memo[][][];

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        n = sc.nextInt();
        int m = sc.nextInt();
        memo = new int[2][2][n];
        for (int[][] a : memo)
            for (int[] b : a)
                Arrays.fill(b, UNCALC);
        int first = add(dp(1, 0, 1), dp(0, 1, 1));
        int[] ans = new int[m + 1], delta = new int[m + 1];
        ans[1] = first;
        delta[1] = 2;
        for (int i = 2; i <= m; i++) {
            delta[i] = add(delta[i - 1], delta[i - 2]);
            ans[i] = add(ans[i - 1], delta[i - 1]);
        }
        out.println(ans[m]);
        out.flush();
        out.close();
    }

    static int dp(int bl, int last, int i) {
        if (i == n) return 1;
        if (memo[bl][last][i] != UNCALC) return memo[bl][last][i];
        int cnt = 0;
        if (last == 0) {
            cnt = dp(last, 1, i + 1);
        } else {
            if (bl == 0) cnt = dp(1, 1, i + 1);
        }
        if (last == 1) cnt = add(cnt, dp(last, 0, i + 1));
        else if (bl == 1) cnt = add(cnt, dp(0, 0, i + 1));
        return memo[bl][last][i] = cnt;
    }

    static int add(int a, int b) {
        long c = a + b;
        if (c >= mod) c -= mod;
        if (c < 0) c += mod;
        return (int) c;
    }

    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {
            br = new BufferedReader(new InputStreamReader(system));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public char nextChar() throws IOException {
            return next().charAt(0);
        }

        public Long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public int[] nextIntArray(int n) throws IOException {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) throws IOException {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }

        public Integer[] nextIntegerArray(int n) throws IOException {
            Integer[] a = new Integer[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public double[] nextDoubleArray(int n) throws IOException {
            double[] ans = new double[n];
            for (int i = 0; i < n; i++)
                ans[i] = nextDouble();
            return ans;
        }

        public short nextShort() throws IOException {
            return Short.parseShort(next());
        }

    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class test3 {
    static long mod=1000000007l;
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine()," ");
        int n=Integer.parseInt(st.nextToken());
        int m=Integer.parseInt(st.nextToken());
        long a=0,b=2;
        long len=0;
        for (int i = 1; i <= n; i++) {
            len=a+b;
            a=b;
            b=len;
            len=len%mod;
            a=a%mod;
            b=b%mod;
        }
        long ans=len;
        a=0;
        b=2;
        len=0;
        for (int i = 1; i <= m; i++) {
            ans+=a;
            len=a+b;
            a=b;
            b=len;
            len=len%mod;
            a=a%mod;
            b=b%mod;
            ans=ans%mod;
        }
        System.out.println(ans);
    }
}

import java.util.Scanner;

public class Ivan_The_Fool_And_The_Probability_Theory {

	public static void main(String[] args) {
     Scanner scn=new Scanner(System.in);
     int n=scn.nextInt();
     int m=scn.nextInt();
    int max=Math.max(n,m)+1;
    long []arr=new long[max];
    arr[0]=1;
    arr[1]=1;
    long mod=1000000007;
    for(int i=2;i<max;i++) {
    	arr[i]=(arr[i-1]+arr[i-2])%mod;
    }
    System.out.println((2*1L*(arr[n]+arr[m]-1L+mod))%mod);
	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        final int MOD = (int) (1e9 + 7);

        public void solve(int testNumber, FastScanner in, PrintWriter out) {
//        if (true) {
            if (false) {
                final int N = 24;
                for (int n = 1; n <= N; n++) {
                    for (int m = n; m * n <= N; m++) {
                        int resSlow = slow(n, m);
//                System.out.println(n + " " + m + " " + (n*m) + " " + resSlow);
                        int resFast = fast(n, m);
                        if (resFast != resSlow) {
//                        throw new AssertionError(n + " " + m + " " + resSlow + " " + resFast);
                            System.out.println(n + " " + m + " " + resSlow + " " + resFast);
                        }

                    }
                }
            }

            int n = in.nextInt();
            int m = in.nextInt();
            out.println(fast(n, m));
        }

        private int fast(int n, int m) {
            int[] f = new int[n + m + 10];
            f[0] = 0;
            f[1] = 1;
            for (int i = 2; i < f.length; i++) {
                f[i] = f[i - 1] + f[i - 2];
                if (f[i] >= MOD) {
                    f[i] -= MOD;
                }
            }

            int res = MOD - 2;
            res = (res + f[n - 1]) % MOD;
            res = (res + f[n + 2]) % MOD;
            res = (res + f[m - 1]) % MOD;
            res = (res + f[m + 2]) % MOD;
            return res;
        }

        private int slow(int n, int m) {
            int[][] a = new int[n][m];
            int res = 0;
            for (int mask = 0; mask < 1 << (n * m); mask++) {
                for (int r = 0; r < n; r++) {
                    for (int c = 0; c < m; c++) {
                        a[r][c] = (mask >> (r * m + c)) & 1;
                    }
                }
                boolean ok = true;
                for (int r = 0; r < n; r++) {
                    for (int c = 0; c < m; c++) {
                        int nei = 0;
                        for (int dr = -1; dr <= 1; dr++) {
                            for (int dc = -1; dc <= 1; dc++) {
                                if (dr == 0 ^ dc == 0) {
                                    int nr = r + dr;
                                    int nc = c + dc;
                                    if (nr < 0 || nr >= n || nc < 0 || nc >= m) {
                                        continue;
                                    }
                                    if (a[r][c] == a[nr][nc]) {
                                        ++nei;
                                    }
                                }
                            }
                        }
                        if (nei > 1) {
                            ok = false;
                        }
                    }
                }
                if (ok) {
                    ++res;
                }
            }
            return res;
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

/**
 * @author Juan Sebastian Beltran Rojas
 * @mail jsbeltran.valhalla@gmail.com
 * @veredict
 * @url
 * @category
 * @date
 **/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

public class CF1239A {
    static long MOD = 1000000007;
    static int N, M;
    static long[] mem;

    public static void main(String args[]) throws Throwable {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for (String ln; (ln = in.readLine()) != null; ) {
            StringTokenizer st = new StringTokenizer(ln);
            N = parseInt(st.nextToken());
            M = parseInt(st.nextToken());
            mem = new long[Math.max(M,N)+1];
            System.out.println((2*f(N)+2*f(M)-2)%MOD);
        }
    }

    static long f(int p) {
        if (p == 0) return 1;
        if (p <0) return 0;
        if(mem[p]>0)return mem[p];
        return mem[p]=(f(p - 1) + f(p - 2)) % MOD;
    }
}

import java.util.*;
public class MyClass {
  static int M=1000000007;
    public static void main(String args[]) {
      Scanner in=new Scanner(System.in);
      int n=in.nextInt();
      int m=in.nextInt();
      int a[]=new int[100005]; a[1]=2;a[2]=4;
      for(int i=3;i<100005;i++) a[i]=(a[i-1]+a[i-2])%M;
      int ans=(a[n]+a[m]-2)%M;

      System.out.println(ans);
    }
}

import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt(), m = s.nextInt();
        int max = Math.max(n, m);
        int[] res = new int[max+1];
        res[1] = 1;
        if (max>1) res[2] = 2;
        for (int i=3; i<=max; i++) res[i] = (res[i-1] + res[i-2])%1000000007;
        long a = res[n], b = res[m];
        long ans = a*2+b*2-2;
        System.out.println(ans%1000000007);
    }
}

import java.util.*;
public class Main {
    public static long MOD = 1_000_000_007;
    public static int n, m, cnt = 0;
    public static void generate(String s) {
        if (s.length() == n * m) {
            char[][] arr = new char[n][m];
            int pos = 0;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    arr[i][j] = s.charAt(pos++);
                }
            }
            boolean flag = true;
            for (int i = 0; i < n; i++) {
                if (!flag) break;
                for (int j = 0; j < m; j++) {
                    int cnt = 0;
                    if (i > 0 && arr[i - 1][j] == arr[i][j]) cnt++;
                    if (j > 0 && arr[i][j - 1] == arr[i][j]) cnt++;
                    if (i < n - 1 && arr[i + 1][j] == arr[i][j]) cnt++;
                    if (j < m - 1 && arr[i][j + 1] == arr[i][j]) cnt++;
                    if (cnt > 1) {
                        flag = false;
                        break;
                    }
                }
            }
            if (flag) {
                cnt++;
            }
        } else {
            generate(s + 'W');
            generate(s + 'B');
        }
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (true) {
            cnt = 0;
            n = in.nextInt();
            m = in.nextInt();
            int min = Math.min(n, m);
            int max = Math.max(n, m);
            // generate("");
            // System.out.println(cnt);
            long basis = 2;
            long ans = 2;
            long a = 0;
            long b = 4;
            long A = 0;
            long B = 4;
            for (int i = 2; i <= min; i++) {
                long c = a + b;
                long C = A + B;
                C %= MOD;
                basis += b;
                ans += B;
                ans %= MOD;
                a = b;
                b = c;
                A = B;
                B = C;
                A %= MOD;
                B %= MOD;
            }
            a = 0;
            b = 2;
            A = 0;
            B = 2;
            for (int i = 0; i < min - 1; i++) {
                long c = a + b;
                a = b;
                b = c;
                long C = A + B;
                C %= MOD;
                A = B;
                B = C;
                A %= MOD;
                B %= MOD;
            }
            for (int i = 0; i < max - min; i++) {
                long c = a + b;
                long C = A + B;
                C %= MOD;
                ans += B;
                ans %= MOD;
                a = b;
                b = c;
                A = B;
                B = C;
                A %= MOD;
                B %= MOD;
            }
            System.out.println(ans % MOD);
            break;
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CIvanTheFoolAndTheProbabilityTheory solver = new CIvanTheFoolAndTheProbabilityTheory();
        solver.solve(1, in, out);
        out.close();
    }

    static class CIvanTheFoolAndTheProbabilityTheory {
        static int[] memo;
        static int mod = (int) 1e9 + 7;

        public int fib(int x) {
            if (x < 2)
                return 1;
            if (memo[x] != 0)
                return memo[x];
            return memo[x] = (fib(x - 1) + fib(x - 2)) % mod;
        }

        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int r = sc.nextInt(), c = sc.nextInt();
            memo = new int[Math.max(r, c) + 1];
            pw.println(2 * ((fib(r) + fib(c) - 1) % mod) % mod);
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.io.*;
import java.util.*;
public class Main {
    public static void main(String args[])
    {
        FastReader input=new FastReader();
        PrintWriter out=new PrintWriter(System.out);
        int T=1;
        while(T-->0)
        {
            long n=input.nextInt();
            long m=input.nextInt();
            long mod=1000000007;
            long a[]=new long[100001];
            a[2]=2;
            a[3]=2;
            long x=2;
            for(int i=1;i<=m;i++)
            {
                if(i>3)
                {
                    a[i]=(a[i-1]%mod+a[i-2]%mod)%mod;
                }
                x=(x%mod+a[i]%mod)%mod;
            }
            a=new long[100001];
            a[2]=2;
            a[3]=2;
            for(int i=1;i<=n;i++)
            {
                if(i>3)
                {
                    a[i]=(a[i-1]%mod+a[i-2]%mod)%mod;
                }
                x=(x%mod+a[i]%mod)%mod;
            }
            out.println(x);
        }
        out.close();
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.LinkedList;

public class Main {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
		String[] cmd=br.readLine().split(" ");
		int n=Integer.valueOf(cmd[0]);
		int m=Integer.valueOf(cmd[1]);
		long a=0;
		long b=2;
		long ans1=0;
		long ans2=0;
		long mod=1000000007;
		for(int i=1;i<=n;i++)
		{
			ans1=(a+b)%mod;
			a=b;
			b=ans1;
		}
		a=0;
		b=2;
		for(int i=1;i<=m;i++)
		{
			ans2=(a+b)%mod;
			a=b;
			b=ans2;
		}
		System.out.println((ans1+ans2-2)%mod);
	}
}

import java.io.*;
import java.util.*;

public class C implements Runnable {
	boolean judge = false;
	FastReader scn;
	PrintWriter out;
	String INPUT = "";

//	02 04 06 10 16 26 42
//	04 06 08 12 18 28 44
//	06 08 10 14 20 30 46
//	10 12 14 18 24 34 50
//	16 18 20 24 30 40 56
//	26 28 30 34 40 50 66
//	42 44 46 50 56 66

	void solve() {
		int mod = (int) 1e9 + 7;
		long[] fib = new long[200000];
		fib[1] = 1;
		for (int i = 2; i < fib.length; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			if (fib[i] >= mod) {
				fib[i] -= mod;
			}
		}

		long[] a = new long[200000];
		for(int i = 3; i < a.length; i++) {
			a[i] = fib[i - 3] + fib[i];
			if(a[i] >= mod) {
				a[i] -= mod;
			}
		}

		int n = scn.nextInt() + 1, m = scn.nextInt() + 2, sub = 0;
		if(n > 4) {
			n++;
			sub = 2;
		}
		long ans = (a[m] + a[n] - sub) % mod;
		ans = (ans + mod) % mod;
		out.println(ans);
	}

	public void run() {
		long time = System.currentTimeMillis();
		boolean oj = System.getProperty("ONLINE_JUDGE") != null || judge;
		out = new PrintWriter(System.out);
		scn = new FastReader(oj);
		solve();
		out.flush();
		if (!oj) {
			System.out.println(Arrays.deepToString(new Object[] { System.currentTimeMillis() - time + " ms" }));
		}
	}

	public static void main(String[] args) {
		new Thread(null, new C(), "Main", 1 << 26).start();
	}

	class FastReader {
		InputStream is;

		public FastReader(boolean onlineJudge) {
			is = onlineJudge ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		}

		byte[] inbuf = new byte[1024];
		public int lenbuf = 0, ptrbuf = 0;

		int readByte() {
			if (lenbuf == -1)
				throw new InputMismatchException();
			if (ptrbuf >= lenbuf) {
				ptrbuf = 0;
				try {
					lenbuf = is.read(inbuf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return -1;
			}
			return inbuf[ptrbuf++];
		}

		boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		int skip() {
			int b;
			while ((b = readByte()) != -1 && isSpaceChar(b))
				;
			return b;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		char nextChar() {
			return (char) skip();
		}

		String next() {
			int b = skip();
			StringBuilder sb = new StringBuilder();
			while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		String nextLine() {
			int b = skip();
			StringBuilder sb = new StringBuilder();
			while ((!isSpaceChar(b) || b == ' ')) { // when nextLine, (isSpaceChar(b) && b != ' ')
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		char[] next(int n) {
			char[] buf = new char[n];
			int b = skip(), p = 0;
			while (p < n && !(isSpaceChar(b))) {
				buf[p++] = (char) b;
				b = readByte();
			}
			return n == p ? buf : Arrays.copyOf(buf, p);
		}

		int nextInt() {
			int num = 0, b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-') {
				minus = true;
				b = readByte();
			}

			while (true) {
				if (b >= '0' && b <= '9') {
					num = num * 10 + (b - '0');
				} else {
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		long nextLong() {
			long num = 0;
			int b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-') {
				minus = true;
				b = readByte();
			}

			while (true) {
				if (b >= '0' && b <= '9') {
					num = num * 10 + (b - '0');
				} else {
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		char[][] nextMatrix(int n, int m) {
			char[][] map = new char[n][];
			for (int i = 0; i < n; i++)
				map[i] = next(m);
			return map;
		}

		int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		int[][] next2DInt(int n, int m) {
			int[][] arr = new int[n][];
			for (int i = 0; i < n; i++) {
				arr[i] = nextIntArray(m);
			}
			return arr;
		}

		long[][] next2DLong(int n, int m) {
			long[][] arr = new long[n][];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLongArray(m);
			}
			return arr;
		}

		int[] shuffle(int[] arr) {
			Random r = new Random();
			for (int i = 1, j; i < arr.length; i++) {
				j = r.nextInt(i);
				int c = arr[i];
				arr[i] = arr[j];
				arr[j] = c;
			}
			return arr;
		}

		long[] shuffle(long[] arr) {
			Random r = new Random();
			for (int i = 1, j; i < arr.length; i++) {
				j = r.nextInt(i);
				long c = arr[i];
				arr[i] = arr[j];
				arr[j] = c;
			}
			return arr;
		}

		int[] uniq(int[] arr) {
			arr = scn.shuffle(arr);
			Arrays.sort(arr);
			int[] rv = new int[arr.length];
			int pos = 0;
			rv[pos++] = arr[0];
			for (int i = 1; i < arr.length; i++) {
				if (arr[i] != arr[i - 1]) {
					rv[pos++] = arr[i];
				}
			}
			return Arrays.copyOf(rv, pos);
		}

		long[] uniq(long[] arr) {
			arr = scn.shuffle(arr);
			Arrays.sort(arr);
			long[] rv = new long[arr.length];
			int pos = 0;
			rv[pos++] = arr[0];
			for (int i = 1; i < arr.length; i++) {
				if (arr[i] != arr[i - 1]) {
					rv[pos++] = arr[i];
				}
			}
			return Arrays.copyOf(rv, pos);
		}

		int[] reverse(int[] arr) {
			int l = 0, r = arr.length - 1;
			while (l < r) {
				arr[l] = arr[l] ^ arr[r];
				arr[r] = arr[l] ^ arr[r];
				arr[l] = arr[l] ^ arr[r];
				l++;
				r--;
			}
			return arr;
		}

		long[] reverse(long[] arr) {
			int l = 0, r = arr.length - 1;
			while (l < r) {
				arr[l] = arr[l] ^ arr[r];
				arr[r] = arr[l] ^ arr[r];
				arr[l] = arr[l] ^ arr[r];
				l++;
				r--;
			}
			return arr;
		}

		int[] compress(int[] arr) {
			int n = arr.length;
			int[] rv = Arrays.copyOf(arr, n);
			rv = uniq(rv);
			for (int i = 0; i < n; i++) {
				arr[i] = Arrays.binarySearch(rv, arr[i]);
			}
			return arr;
		}

		long[] compress(long[] arr) {
			int n = arr.length;
			long[] rv = Arrays.copyOf(arr, n);
			rv = uniq(rv);
			for (int i = 0; i < n; i++) {
				arr[i] = Arrays.binarySearch(rv, arr[i]);
			}
			return arr;
		}
	}
}

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class Main {

    long MODULO = 1000_000_007;
    int INF = Integer.MAX_VALUE - 1234567;

    void solve() throws IOException {
        int n = readInt();
        int m = readInt();
        int max = Math.max(n, m);
        int min = Math.min(m, n);

        long[][] dp1 = new long[min][2];
        dp1[0][0] = 1;
        for (int i=1; i<min; ++i){
            dp1[i][0] = (dp1[i-1][0] + dp1[i-1][1]) % MODULO;
            dp1[i][1] = dp1[i - 1][0];
        }

        long[][] dp2 = new long[max][2];
        dp2[0][0] = 1;
        for (int i=1; i<max; ++i){
            dp2[i][0] = (dp2[i-1][0] + dp2[i-1][1]) % MODULO;
            dp2[i][1] = dp2[i - 1][0];
        }
        out.println((dp2[max-1][0] + dp2[max-1][1] + dp1[min-1][0] + dp1[min-1][1] - 1) * 2 % MODULO);
    }

    long gcd(long a, long b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    int[][] steps = {{1, 0}, {0, 1}};
    String fileName = "";
    private final static Random rnd = new Random();

    boolean checkBit(long mask, int bit) {
        return (mask & (1l << bit)) > 0;
    }

    ////////////////////////////////////////////////////////////
    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        new Main().run();
    }

    void run() throws NumberFormatException, IOException {
        solve();
        out.close();
    }

    ;

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok;
    String delim = " ";

    Main() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }

        }
        tok = new StringTokenizer("");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) {
                return null;
            }

            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken(delim);
    }

    int readInt() throws NumberFormatException, IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws NumberFormatException, IOException {
        return Long.parseLong(readString());
    }

    int[] readIntArray(int n) throws NumberFormatException, IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; ++i) {
            a[i] = readInt();
        }
        return a;
    }

    double readDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(readString());
    }
}

import java.util.*;

public class IvanTheFool2 {

	static int MOD = 1000000007;

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] arr = new int[100000];
		arr[0] = 2;
		arr[1] = 4;
		for (int i = 2; i < arr.length; i++) {
			arr[i] = arr[i - 1] + arr[i - 2];
			arr[i] = arr[i] % MOD;
		}

		long sol=((arr[m-1]+arr[n-1])-2)%MOD;

		System.out.println(sol);

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Comparator;

public class d {
    static BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
    // static Scanner s=new Scanner(System.in);
    public static void main(String[] args) throws IOException {
        StringBuilder sb = new StringBuilder();
        String[] s1=s();
        int n=i(s1[0]);int m=i(s1[1]);
        int mod=1000000007;
        long prev=2;long ans=0;
        long[][] dp=new long[Math.max(m,n)][2];
        dp[0][0]=2;dp[0][1]=0;
        for(int i=1;i<n;i++){
            dp[i][0]=(dp[i-1][1]+dp[i-1][0])%mod;
            dp[i][1]=dp[i-1][0];
        }
        ans=dp[n-1][1]+dp[n-1][0];
        dp[0][0]=2;dp[0][1]=0;
        for(int i=1;i<m;i++) {
            dp[i][0]=(dp[i-1][1]+dp[i-1][0])%mod;
            dp[i][1]=dp[i-1][0];
        }ans=(ans+dp[m-1][1]+dp[m-1][0]-2+mod)%mod;
        System.out.println((ans)%mod);
        //        System.out.println(sb.toString());
//        System.out.println(ans);
    }static void calculatefac(int mod){
        fac[0]=1;
        for (int i = 1 ;i <= MAXN; i++)
            fac[i] = fac[i-1] * i % mod;
    }
    static int MAXN;
    static int[] spf;
  static long powerwithmod(long  x, long y, long p) {
        long  res = 1;
        x = x % p;
        while (y > 0) {
            if ((y & 1) == 1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }static long modInverse(long a, long m)
    {
        return (powerwithmod(a, m - 2, m));
    }

    static long[] fac ;
    static long nCrModPFermat(int n, int r, long mod) {
        if (r == 0)
            return 1;
        fac[0] = 1;
        return (fac[n]*
                modInverse(fac[r], mod)
                % mod * modInverse(fac[n-r], mod)
                % mod) % mod;
    }
    static String[] s() throws IOException {

        return s.readLine().trim().split("\\s+");
    }

    static int i(String ss) {
        return Integer.parseInt(ss);
    }
    static long l(String ss) {
        return Long.parseLong(ss);
    }
}

class Student12 {
    int  l;int r;
    public Student12(int l, int r) {
        this.l = l;
        this.r = r;
    }

    public String toString()
    {
        return this.l+" ";
    }
}
class Sortbyroll12 implements Comparator<Student12> {

    public int compare(Student12 a, Student12 b){
       /* if(b.r<a.r) return -1;
        else if(b.r==a.r) return 0;
        return 1;*/
        if(b.r-b.l>a.r-a.l) return 1;
        else if(b.r-b.l==a.r-a.l) {
            return a.l-b.l;
        }else return -1;/*
       if(b.l<a.l) return -1;
       else if(b.l==a.l) {
           return b.r-a.r;
       }
       return 1;*/
        //        return b.r- a.r;
        //        return (int) a.l-(int) b.l;
         /*   if(a.r<b.r) return -1;
            else if(a.r==b.r){
                if(a.r==b.r){
                    return 0;
                }
                if(a.r<b.r) return -1;
                return 1;}
            return 1;  */}
}

//package div3;

import java.io.*;
import java.util.List;
import java.util.StringTokenizer;

public class board
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    static void print(List<Integer> l){
        for(int ele:l){
            System.out.print(ele+" ");
        }
        System.out.println();
    }
    static Integer[][][] dp;
    static long mod = (int)(1e9+7);
    static long add(long a,long b){
        return (a%mod+b%mod)%mod;
    }
//    static int mul(int a,int b){
//        return (a%mod * b%mod)%mod;
//    }

    public static void main(String[] args)
    {
        FastReader sc=new FastReader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        //int t  = sc.nextInt();

        int n = sc.nextInt();
        int m = sc.nextInt();

        long[] cal = new long[Math.max(n+1,m+1)];

        cal[1] = 2;
        if(Math.max(m,n)>=2)
        cal[2] = 4;
        for(int i=3;i<=Math.max(m,n);i++){
            cal[i] = add(cal[i-1],cal[i-2]);
            //System.out.println(cal[i]);
        }

        long ways = cal[m];
        if(m == 1){
            System.out.println(cal[n]);
        }
        else {
            //System.out.println(go(0,0,0,m));
            //System.out.println(ways+" "+pow[n]);
            System.out.println(add((ways - 2),cal[n]));
        }
        //out.close();

    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.Arrays;

public class Solution {
	public static void main(String[] args) throws IOException {
	    // Read inputs
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());

		// Wlog n > m
		if(n< m){
		    int temp = m;
		    m = n;
		    n = temp;
		}
		long[] dp = new long[n];
		dp[0] = 1;
		if(n<2){
		    System.out.println(2);
		    return;
		}
		dp[1] = 2;
		for(int i = 2; i< n; i++){
		    dp[i] = (dp[i-1] + dp[i-2]) % (1000000000+7);
		}
		long ans = ((dp[n-1] * 2)% (1000000000+7)) + ((dp[m-1] * 2)% (1000000000+7)) - 2;

	    System.out.println(ans % (1000000000+7));
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AIvanTheFoolAndTheProbabilityTheory solver = new AIvanTheFoolAndTheProbabilityTheory();
        solver.solve(1, in, out);
        out.close();
    }

    static class AIvanTheFoolAndTheProbabilityTheory {
        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int[] fib = new int[(int) 1e5 + 1];
            fib[0] = fib[1] = 1;
            for (int i = 2; i < fib.length; i++)
                fib[i] = (fib[i - 1] + fib[i - 2]) % ((int) 1e9 + 7);
            pw.println((2l * (fib[n] + fib[m] - 1)) % ((int) 1e9 + 7));
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

/**
 * @author egaeus
 * @mail sebegaeusprogram@gmail.com
 * @veredict Accepted
 * @url <https://codeforces.com/problemset/problem/1239/A>
 * @category dp
 * @date 21/10/2019
 **/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

public class CF1239A {
    static long MOD = 1000000007;
    static int N, M;
    static long[] mem;

    public static void main(String args[]) throws Throwable {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for (String ln; (ln = in.readLine()) != null; ) {
            StringTokenizer st = new StringTokenizer(ln);
            N = parseInt(st.nextToken());
            M = parseInt(st.nextToken());
            mem = new long[Math.max(M,N)+1];
            System.out.println((2*f(N)+2*f(M)-2)%MOD);
        }
    }

    static long f(int p) {
        if (p == 0) return 1;
        if (p <0) return 0;
        if(mem[p]>0)return mem[p];
        return mem[p]=(f(p - 1) + f(p - 2)) % MOD;
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class contest {
	static long A = 1000000000+7;
	static long[] fib = new long[100002];
	public static long fib(int n) {
		if(n<0)return 0;
		if(fib[n]!=0)return fib[n];
		fib[0]=1;
		fib[1]=2;
		fib[2]=4;
		for(int i=3;i<=n;i++) {
			fib[i]=(fib[i-1]%A+fib[i-2]%A)%A;
		}
		return fib[n];
	}
	public static long f(int n ,int m) {
		long r=(fib(n)+fib(m)-2)%A;

		return r;
	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		System.out.println(f(sc.nextInt(),sc.nextInt()));
		pw.flush();
		pw.close();
	}

}

import java.util.*;
import java.io.*;
public class A594
{
    public static void main(String [] args)
    {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        long mod = 1000000000+7;
        int n = sc.nextInt(); int m = sc.nextInt();
        int max = Math.max(n, m);
        long [] w = new long [max+1];
        long [] b = new long [max+1];
        w[1] = 1; b[1] = 1;
        if (max >= 2) {
            w[2] = 2;
            b[2] = 2;
        }
        for (int i = 3; i <= max; i++) {
            w[i] = (b[i-1] + b[i-2])%mod;
            b[i] = (w[i-1] + w[i-2])%mod;
        }
        long ans = ((((w[m] + b[m])%mod - 2)%mod + w[n])%mod + b[n])%mod;
        out.println(ans);

        out.close();
    }

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    static long inf = Long.MAX_VALUE / 2;
    static int mod = (int) 1e9 + 7;

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        int n = nextInt();
        int m = nextInt();
        long[] dp = new long[100002];
        dp[0] = 1;
        dp[1] = 1;
        for (int i = 2; i < 100002; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        out.print(2L * (dp[n] + dp[m] - 1) % mod);
        out.close();
    }

    static PrintWriter out;
    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static String next() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author xylenox
 */
public class c {
    public static void main(String[] args) {
        FS in = new FS(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int m = in.nextInt();
        long prev = 2;
        long next = 2;
        long tot = 1000000005;
        for(int i = 1; i <= Math.max(n, m); i++) {
            if(i == n) tot = (tot+next)%1000000007;
            if(i == m) tot = (tot+next)%1000000007;
            long tmp = next;
            next = (next+prev)%1000000007;
            prev = tmp;
        }
        out.println(tot);
        out.close();
    }

    static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a%b);
    }

    static class FS {
        BufferedReader in;
        StringTokenizer token;

        public FS(InputStream st) {
            in = new BufferedReader(new InputStreamReader(st));
        }

        public String next() {
            if(token == null || !token.hasMoreElements()) {
                try {
                    token = new StringTokenizer(in.readLine());
                } catch(Exception e) {}
                return next();
            }
            return token.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;

public class SymbolsStats {
    static final long divisor = 1_000_000_000L + 7;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        PrintWriter printWriter = new PrintWriter(System.out);
        int n, k;
        n = scanner.nextInt();
        k = scanner.nextInt();
        int res = 2;
        long sn = sums(n);
        long sk = sums(k);
        System.out.println((res + 2*(sn + sk)) % divisor);
    }

    static long sums(int n) {
        if (n == 0) return 0;
        long f = 0, s = 1;
        for (int i = 0; i < n; i++) {
            long t = (f + s) % divisor;
            f = s;
            s = t;
        }
        return (s - 1) % divisor;
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
//import java.math.*;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */

public class Main {

	static int MD= 1000000007;
    public static void main(String[] args) throws IOException {
    	OutputStream outputStream = System.out;
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {

        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
        	int t=1;
        	long[] a=new long[100001];
        	a[0]=1;
        	a[1]=1;
        	for(int i=2;i<=100000;i++) {
        		a[i]=a[i-1]+a[i-2];
        		a[i]%=MD;
        	}

        	while(t-->0) {
        		int n=in.nextInt();
        		int m=in.nextInt();
        	//	out.println(a[n]+" "+a[m]);
        		long ans=(a[n]+a[m])%MD;
        		ans*=2;

        		ans-=2;
        		ans%=MD;

        		out.println((ans+MD)%MD);

        	}

        }

    }

    static class InputReader
    {
        BufferedReader br;
        StringTokenizer st;

        public InputReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }

    }
    static void sort(int[] a, int low, int high)
    {
        int N = high - low;
        if (N <= 1)
            return;
        int mid = low + N/2;
        sort(a, low, mid);
        sort(a, mid, high);
        int[] temp = new int[N];
        int i = low, j = mid;
        for (int k = 0; k < N; k++)
        {
            if (i == mid)
                temp[k] = a[j++];
            else if (j == high)
                temp[k] = a[i++];
            else if (a[j]<a[i])
                temp[k] = a[j++];
            else
                temp[k] = a[i++];
        }
        for (int k = 0; k < N; k++)
            a[low + k] = temp[k];
    }
    public static long fexp(long x, long y, long p) {
        long res = 1;

        x = x % p;

        while (y > 0)
        {

            if((y & 1)==1)
                res = (res * x) % p;

            y = y >> 1;
            x = (x * x) % p;
        }
        return res;

    }
    static int gcd(int a, int b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);

    }

}

import java.util.*;
import java.io.*;
public class EdC {

	public static void main(String[] args) throws Exception{
		int num = 1000000007;
		long[] fib = new long[100005];
		fib[0] = 1;
		fib[1] = 1;
		for(int j = 2;j<=100004;j++){
			fib[j] = (fib[j-1] + fib[j-2])%num;
		}
		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);

	 		StringTokenizer st = new StringTokenizer(bf.readLine());
	 		int n = Integer.parseInt(st.nextToken());
	 		int m = Integer.parseInt(st.nextToken());
	 	out.println((2*(fib[n]+fib[m]-1))%num);

 		out.println();

 		out.close();

 	}
}

//StringJoiner sj = new StringJoiner(" ");
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is

/**
 * Date: 20 Oct, 2019
 * Link: https://codeforces.com/contest/1248/problem/C
 *
 * @author Prasad Chaudhari
 * @linkedIn: https://www.linkedin.com/in/prasad-chaudhari-841655a6/
 * @git: https://github.com/Prasad-Chaudhari
 */
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;

public class C_1248 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        FastIO in = new FastIO();
        int n = in.ni();
        int m = in.ni();
        long mod = (long) (1e9) + 7;
        long fib[] = new long[Math.max(n, m) + 1];
        fib[1] = 1;
        fib[0] = 1;
        for (int i = 2; i <= Math.max(n, m); i++) {
            fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
        }
        System.out.println(((fib[n] + fib[m] - 1) * 2) % mod);
        in.bw.flush();
    }

    static class Data implements Comparable<Data> {

        int a, b;

        public Data(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(Data o) {
            if (a == o.a) {
                return Integer.compare(b, o.b);
            }
            return Integer.compare(a, o.a);
        }

        public static void sort(int a[]) {
            Data d[] = new Data[a.length];
            for (int i = 0; i < a.length; i++) {
                d[i] = new Data(a[i], 0);
            }
            Arrays.sort(d);
            for (int i = 0; i < a.length; i++) {
                a[i] = d[i].a;
            }
        }
    }

    static class FastIO {

        private final BufferedReader br;
        private final BufferedWriter bw;
        private String s[];
        private int index;

        public FastIO() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
            bw = new BufferedWriter(new OutputStreamWriter(System.out, "UTF-8"));
            s = br.readLine().split(" ");
            index = 0;
        }

        public int ni() throws IOException {
            return Integer.parseInt(nextToken());
        }

        public double nd() throws IOException {
            return Double.parseDouble(nextToken());
        }

        public long nl() throws IOException {
            return Long.parseLong(nextToken());
        }

        public String next() throws IOException {
            return nextToken();
        }

        public String nli() throws IOException {
            try {
                return br.readLine();
            } catch (IOException ex) {

            }
            return null;
        }

        public int[] gia(int n) throws IOException {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }

        public int[] gia(int n, int start, int end) throws IOException {
            validate(n, start, end);
            int a[] = new int[n];
            for (int i = start; i < end; i++) {
                a[i] = ni();
            }
            return a;
        }

        public double[] gda(int n) throws IOException {
            double a[] = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }

        public double[] gda(int n, int start, int end) throws IOException {
            validate(n, start, end);
            double a[] = new double[n];
            for (int i = start; i < end; i++) {
                a[i] = nd();
            }
            return a;
        }

        public long[] gla(int n) throws IOException {
            long a[] = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }

        public long[] gla(int n, int start, int end) throws IOException {
            validate(n, start, end);
            long a[] = new long[n];
            for (int i = start; i < end; i++) {
                a[i] = nl();
            }
            return a;
        }

        public int[][][] gwtree(int n) throws IOException {
            int m = n - 1;
            int adja[][] = new int[n + 1][];
            int weight[][] = new int[n + 1][];
            int from[] = new int[m];
            int to[] = new int[m];
            int count[] = new int[n + 1];
            int cost[] = new int[n + 1];
            for (int i = 0; i < m; i++) {
                from[i] = i + 1;
                to[i] = ni();
                cost[i] = ni();
                count[from[i]]++;
                count[to[i]]++;
            }
            for (int i = 0; i <= n; i++) {
                adja[i] = new int[count[i]];
                weight[i] = new int[count[i]];
            }
            for (int i = 0; i < m; i++) {
                adja[from[i]][count[from[i]] - 1] = to[i];
                adja[to[i]][count[to[i]] - 1] = from[i];
                weight[from[i]][count[from[i]] - 1] = cost[i];
                weight[to[i]][count[to[i]] - 1] = cost[i];
                count[from[i]]--;
                count[to[i]]--;
            }
            return new int[][][] { adja, weight };
        }

        public int[][][] gwg(int n, int m) throws IOException {
            int adja[][] = new int[n + 1][];
            int weight[][] = new int[n + 1][];
            int from[] = new int[m];
            int to[] = new int[m];
            int count[] = new int[n + 1];
            int cost[] = new int[n + 1];
            for (int i = 0; i < m; i++) {
                from[i] = ni();
                to[i] = ni();
                cost[i] = ni();
                count[from[i]]++;
                count[to[i]]++;
            }
            for (int i = 0; i <= n; i++) {
                adja[i] = new int[count[i]];
                weight[i] = new int[count[i]];
            }
            for (int i = 0; i < m; i++) {
                adja[from[i]][count[from[i]] - 1] = to[i];
                adja[to[i]][count[to[i]] - 1] = from[i];
                weight[from[i]][count[from[i]] - 1] = cost[i];
                weight[to[i]][count[to[i]] - 1] = cost[i];
                count[from[i]]--;
                count[to[i]]--;
            }
            return new int[][][] { adja, weight };
        }

        public int[][] gtree(int n) throws IOException {
            int adja[][] = new int[n + 1][];
            int from[] = new int[n - 1];
            int to[] = new int[n - 1];
            int count[] = new int[n + 1];
            for (int i = 0; i < n - 1; i++) {
                from[i] = i + 1;
                to[i] = ni();
                count[from[i]]++;
                count[to[i]]++;
            }
            for (int i = 0; i <= n; i++) {
                adja[i] = new int[count[i]];
            }
            for (int i = 0; i < n - 1; i++) {
                adja[from[i]][--count[from[i]]] = to[i];
                adja[to[i]][--count[to[i]]] = from[i];
            }
            return adja;
        }

        public int[][] gg(int n, int m) throws IOException {
            int adja[][] = new int[n + 1][];
            int from[] = new int[m];
            int to[] = new int[m];
            int count[] = new int[n + 1];
            for (int i = 0; i < m; i++) {
                from[i] = ni();
                to[i] = ni();
                count[from[i]]++;
                count[to[i]]++;
            }
            for (int i = 0; i <= n; i++) {
                adja[i] = new int[count[i]];
            }
            for (int i = 0; i < m; i++) {
                adja[from[i]][--count[from[i]]] = to[i];
                adja[to[i]][--count[to[i]]] = from[i];
            }
            return adja;
        }

        public void print(String s) throws IOException {
            bw.write(s);
        }

        public void println(String s) throws IOException {
            bw.write(s);
            bw.newLine();
        }

        public void print(int s) throws IOException {
            bw.write(s + "");
        }

        public void println(int s) throws IOException {
            bw.write(s + "");
            bw.newLine();
        }

        public void print(long s) throws IOException {
            bw.write(s + "");
        }

        public void println(long s) throws IOException {
            bw.write(s + "");
            bw.newLine();
        }

        public void print(double s) throws IOException {
            bw.write(s + "");
        }

        public void println(double s) throws IOException {
            bw.write(s + "");
            bw.newLine();
        }

        private String nextToken() throws IndexOutOfBoundsException, IOException {
            if (index == s.length) {
                s = br.readLine().split(" ");
                index = 0;
            }
            return s[index++];
        }

        private void validate(int n, int start, int end) {
            if (start < 0 || end >= n) {
                throw new IllegalArgumentException();
            }
        }
    }
}

import java.util.*;
import java.io.*;
import java.lang.*;
public class test1{
	/*static double res=0;
	 static void help(int p,int r,int n){
		double tmp=p;
		for(int i=1;i<=n;i++){
			double x=1+(double)r/1200 ;
			tmp*=x;
		}
		res+=tmp;
		int k=100000,m=360;
		for(int i=m;i>0;i--){
			help(k,5,i);
		}
		System.out.println("paid amount "+k*m+" ");
		System.out.println((long)res);
	}
*/

public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
         StringBuilder sb=new StringBuilder();
         long M=(long)1e9+7;
        	int n=s.nextInt(),m=s.nextInt();
        	long[] f=new long[Math.max(n,m)+1];
        	f[0]=1;f[1]=1;
        	for(int i=2;i<=Math.max(n,m);i++){
        		f[i]=(f[i-1]+f[i-2])%M;
        	}
        	long res=f[n]+f[m]-1;res=(res*2)%M;
        System.out.println(res);
    }
}

//0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(System.out);
        long arr[]=new long[100001];
        arr[0]=1;
        arr[1]=1;
        for(int i=2;i<=100000;i++)
        arr[i]=(arr[i-1]+arr[i-2])%1000000007;
        String str[]=br.readLine().split(" ");
        int n=Integer.parseInt(str[0]);
        int m=Integer.parseInt(str[1]);
        pw.println(2*(arr[n]+arr[m]-1)%1000000007);
        pw.flush();
        pw.close();
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    private static final int MODULO = (int) 1e9 + 7;
    private FastScanner in;
    private PrintWriter out;

    public static void main(String[] args) {
        (new Main()).run();
    }

    private void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
            solve();
            in.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private void solve() throws IOException {
        int n = in.nextInt();
        int m = in.nextInt();
        long[][] dp = new long[Math.max(m, n) + 5][2];
        dp[1][0] = 1;
        dp[1][1] = 0;
        dp[2][0] = 1;
        dp[2][1] = 1;
        for (int i = 3; i < dp.length; i++) {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][0];
            dp[i][0] %= MODULO;
            dp[i][1] %= MODULO;
        }
        out.println((dp[n][0] + dp[n][1] + dp[m][0] + dp[m][1] - 1) * 2 % MODULO);
    }

    private static class FastScanner {
        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        FastScanner(InputStream inputStream) {
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }

        String next() throws IOException {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                String line = bufferedReader.readLine();
                if (line == null) {
                    return null;
                }
                stringTokenizer = new StringTokenizer(line);
            }
            return stringTokenizer.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        void close() throws IOException {
            bufferedReader.close();
        }
    }
}

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Locale;
import java.util.StringTokenizer;

public class Solution implements Runnable {

	public static final int MOD = 1000 * 1000 * 1000 + 7;

	private PrintStream out;
	private BufferedReader in;
	private StringTokenizer st;

	public void solve() throws IOException {
		long time0 = System.currentTimeMillis();

		int n = nextInt();
		int m = nextInt();
		int answer = solve(n, m);
		out.println(answer);

		System.err.println("time: " + (System.currentTimeMillis() - time0));
	}

	private int solve(int n, int m) {
		return (solve(n) + solve(m) - 2) % MOD;
	}

	private int solve(int n) {
		int p0 = 2 % MOD;
		int pp = 0;
		for (int i = 1; i <= n; i++) {
			int pn = (p0 + pp) % MOD;
			pp = p0;
			p0 = pn;
		}
		return p0;
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	public String next() throws IOException {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null) {
				return null;
			}
			st = new StringTokenizer(line);
		}
		return st.nextToken();
	}

	@Override
	public void run() {
		try {
			solve();
			out.close();
		} catch (Throwable e) {
			throw new RuntimeException(e);
		}
	}

	public Solution(String name) throws IOException {
		Locale.setDefault(Locale.US);
		if (name == null) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintStream(new BufferedOutputStream(System.out));
		} else {
			in = new BufferedReader(new InputStreamReader(new FileInputStream(name + ".in")));
			out = new PrintStream(new BufferedOutputStream(new FileOutputStream(name + ".out")));
		}
		st = new StringTokenizer("");
	}

	public static void main(String[] args) throws IOException {
		new Thread(new Solution(null)).start();
	}
}

import javax.print.attribute.IntegerSyntax;
import java.io.*;
import java.util.*;

/**
 * A simple template for competitive programming problems.
 */
public class Banana {
    final InputReader in = new InputReader(System.in);
    final PrintWriter out = new PrintWriter(System.out);

    final long mod = 1000000007;

    final boolean DEBUG = false;
    void solve() {
        int n = in.nextInt(); int m = in.nextInt();
        int max = Math.max(n, m);
        long[] dp = new long[max+1];

        dp[1] = 2;
        long same = 0; long dif = 2;
        for(int i=2; i<=max; i++) {
            long newSame = dif;
            long newDif = (same+dif) % mod;
            same = newSame; dif = newDif;
            dp[i] = (same + dif) % mod;
        }

        long ans = (dp[n] - 2 + dp[m]) % mod;

        out.println(ans);
    }

    public static void main(String[] args) throws FileNotFoundException { Banana s = new Banana(); s.solve(); s.out.close(); }

    public Banana() throws FileNotFoundException { }

    private static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        InputReader(InputStream stream) {
            this.stream = stream;
        }

        InputReader(String fileName) {
            InputStream stream = null;
            try {
                stream = new FileInputStream(fileName);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
            this.stream = stream;
        }

        int[] nextArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = nextInt();
            return arr;
        }

        int[][] nextMatrix(int n, int m) {
            int[][] matrix = new int[n][m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    matrix[i][j] = nextInt();
            return matrix;
        }

        String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        double nextDouble() {
            return Double.parseDouble(nextString());
        }

        private int read() {
            if (numChars == -1) throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try { numChars = stream.read(buf); }
                catch (IOException e) { throw new InputMismatchException(); }
                if (numChars <= 0) return -1;
            }
            return buf[curChar++];
        }

        private boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }

        private boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
    }

}

import java.io.File;
import java.util.Scanner;
import java.util.StringTokenizer;

public class p004 {
	public static void main(String args[]) throws Exception {
		StringTokenizer stok = new StringTokenizer(new Scanner(System.in).useDelimiter("\\A").next());
		StringBuilder sb = new StringBuilder();
		int n = Integer.parseInt(stok.nextToken());
		int m = Integer.parseInt(stok.nextToken());
		long mod = (long)1e9+7;
		long[][] dp = new long[100005][2];
		dp[1][0]=2;
		for(int i=2;i<=100000;i++) {
			dp[i][0]=(dp[i-1][0]+dp[i-1][1])%mod;
			dp[i][1]=dp[i-1][0];
		}
		long tot = (dp[n][0]+dp[n][1]+dp[m][0]+dp[m][1]+mod-2)%mod;
		System.out.println(tot);
	}
}

import javax.print.attribute.IntegerSyntax;
import java.io.*;
import java.util.*;

/**
 * A simple template for competitive programming problems.
 */
public class Banana {
    final InputReader in = new InputReader(System.in);
    final PrintWriter out = new PrintWriter(System.out);

    final long mod = 1000000007;

    final boolean DEBUG = false;
    void solve() {
        int n = in.nextInt(); int m = in.nextInt();
        int max = Math.max(n, m);
        long[] dp = new long[max+1];

        dp[1] = 2;
        if(max>=2) dp[2] = 4;
        long same = 2; long dif = 2;
        for(int i=3; i<=max; i++) {
            long newSame = dif;
            long newDif = (same+dif) % mod;
            same = newSame; dif = newDif;
            dp[i] = (same + dif) % mod;
        }

        //out.println(dp[n] + " " + dp[m]);
        long ans = (dp[n] - 2 + dp[m]) % mod;

        out.println(ans);
    }

    public static void main(String[] args) throws FileNotFoundException { Banana s = new Banana(); s.solve(); s.out.close(); }

    public Banana() throws FileNotFoundException { }

    private static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        InputReader(InputStream stream) {
            this.stream = stream;
        }

        InputReader(String fileName) {
            InputStream stream = null;
            try {
                stream = new FileInputStream(fileName);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
            this.stream = stream;
        }

        int[] nextArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = nextInt();
            return arr;
        }

        int[][] nextMatrix(int n, int m) {
            int[][] matrix = new int[n][m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    matrix[i][j] = nextInt();
            return matrix;
        }

        String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        double nextDouble() {
            return Double.parseDouble(nextString());
        }

        private int read() {
            if (numChars == -1) throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try { numChars = stream.read(buf); }
                catch (IOException e) { throw new InputMismatchException(); }
                if (numChars <= 0) return -1;
            }
            return buf[curChar++];
        }

        private boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }

        private boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ilyakor
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        static final int mod = 1000 * 1000 * 1000 + 7;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
//        for (int i = 1; i <= 8; ++i) {
//            for (int j = 1; j <= 8; ++j) {
//                out.print(doSolve(i, j) / 2 + " ");
//            }
//            out.printLine();
//        }
//
//        int n = in.nextInt();
//        int m = in.nextInt();
//        int res = doSolve(n, m);
//        out.printLine(res);

            int n = in.nextInt();
            int m = in.nextInt();
            int[] f = new int[110 * 1000];
            f[0] = 1;
            f[1] = 1;
            for (int i = 2; i < f.length; ++i) {
                f[i] = (f[i - 1] + f[i - 2]) % mod;
            }
            int res = f[n] + f[m];
            res %= mod;
            res += mod - 1;
            res %= mod;
            res *= 2;
            res %= mod;
            out.printLine(res);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buffer = new byte[10000];
        private int cur;
        private int count;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public static boolean isSpace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int read() {
            if (count == -1) {
                throw new InputMismatchException();
            }
            try {
                if (cur >= count) {
                    cur = 0;
                    count = stream.read(buffer);
                    if (count <= 0)
                        return -1;
                }
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            return buffer[cur++];
        }

        public int readSkipSpace() {
            int c;
            do {
                c = read();
            } while (isSpace(c));
            return c;
        }

        public int nextInt() {
            int sgn = 1;
            int c = readSkipSpace();
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = read();
            } while (!isSpace(c));
            res *= sgn;
            return res;
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}

import java.io.*;
import java.util.StringTokenizer;

public class mainC {
    public static PrintWriter out = new PrintWriter(System.out);
    public static FastScanner enter = new FastScanner(System.in);

    public static void main(String[] args) throws IOException {
        solve();
        out.close();
    }
    static long mod=(long)1e9+7;
    static long dp[][][];
    private static void solve() throws IOException {
        int n=enter.nextInt();
        int m=enter.nextInt();
        if(n==m && m==1){
            out.println(2);
            return;
        }
        dp=new long[Math.max(m+1,n+1)][2][2];
        for (int i = 0; i <2 ; i++) {
            for (int j = 0; j <2 ; j++) {
                dp[1][i][j]=1;
                dp[2][i][j]=1;
            }
        }
        for (int i = 3; i <dp.length ; i++) {
            dp[i][0][0]+=dp[i-1][0][1];
            dp[i][0][1]+=(dp[i-1][1][0]+dp[i-1][1][1])%mod;
            dp[i][1][0]+=(dp[i-1][0][0]+dp[i-1][0][1])%mod;
            dp[i][1][1]+=dp[i-1][1][0];
            for (int j = 0; j <2 ; j++) {
                for (int k = 0; k <2 ; k++) {
                    dp[i][j][k]%=mod;
                }
            }
        }
        if(n==1){
            long ansss=dp[m][1][0]+dp[m][1][1]+dp[m][0][0]+dp[m][0][1];
            ansss%=mod;
            out.println(ansss);
            return;
        }
        if(m==1){
            long ansss=dp[n][1][0]+dp[n][1][1]+dp[n][0][0]+dp[n][0][1];
            ansss%=mod;
            out.println(ansss);
            return;
        }
        long ans=0;
        ans+=(dp[m][1][0]+dp[m][1][1]+dp[m][0][0]+dp[m][0][1]-2)%mod;
        ans%=mod;
        ans+=(dp[n][1][0]+dp[n][1][1]+dp[n][0][1]+dp[n][0][0])%mod;
        ans%=mod;
        out.println(ans);
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer stok;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        String next() throws IOException {
            while (stok == null || !stok.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null) {
                    return null;
                }
                stok = new StringTokenizer(s);
            }
            return stok.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        char nextChar() throws IOException {
            return (char) (br.read());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }
    }
}

/*Author: Satyajeet Singh, Delhi Technological University*/
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.lang.*;
    import java.math.*;

public class Main{
/*********************************************Constants******************************************/
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static long mod=(long)1e9+7;
    static long mod1=998244353;
    static boolean sieve[];
    static ArrayList<Integer> primes;
    static long factorial[],invFactorial[];
    static ArrayList<Pair> graph[];
    static boolean oj = System.getProperty("ONLINE_JUDGE") != null;
/****************************************Solutions Begins***************************************/
    static long dp[][][];
    static int lim;

    static long dfs(int i,int f,int c){
        if(i==lim){
            return 1;
        }
        if(dp[i][f][c]!=-1){
            return dp[i][f][c];
        }
        long ans=0;
        if(f==1){
            ans=dfs(i+1,0,c^1);
        }
        else{
            ans=(dfs(i+1,f+1,c)+dfs(i+1,0,c^1))%mod;
        }
        dp[i][f][c]=ans;
        return ans;
    }
    public static void main(String[] args) throws Exception{
        String st[]=nl();
        int n=pi(st[0]);
        int m=pi(st[1]);
        lim=n;
        dp=new long[lim][2][2];
        for(long arr[][]:dp)
            for(long ar1[]:arr)
                Arrays.fill(ar1,-1);
        long ans=(dfs(1,0,1)+dfs(1,0,0))%mod;
        lim=m;
        dp=new long[lim][2][2];
        for(long arr[][]:dp)
            for(long ar1[]:arr)
                Arrays.fill(ar1,-1);
        long ans2=(dfs(1,0,1)+dfs(1,0,0))%mod;
        //debug(ans,ans2);
        ans=(ans+ans2)%mod;
        ans=(ans-2+mod)%mod;
        out.println(ans);
/****************************************Solutions Ends**************************************************/
        out.flush();
        out.close();
    }
/****************************************Template Begins************************************************/
    static String[] nl() throws Exception{
        return br.readLine().split(" ");
    }
    static String[] nls() throws Exception{
        return br.readLine().split("");
    }
    static int pi(String str) {
        return Integer.parseInt(str);
    }
    static long pl(String str){
        return Long.parseLong(str);
    }
    static double pd(String str){
        return Double.parseDouble(str);
    }
/***************************************Precision Printing**********************************************/
    static void printPrecision(double d){
        DecimalFormat ft = new DecimalFormat("0.000000000000000000000");
        out.print(ft.format(d));
    }
/**************************************Bit Manipulation**************************************************/
    static void printMask(long mask){
        System.out.println(Long.toBinaryString(mask));
    }
    static int countBit(long mask){
        int ans=0;
        while(mask!=0){
            if(mask%2==1){
                ans++;
            }
            mask/=2;
        }
        return ans;
    }
/******************************************Graph*********************************************************/
    static void Makegraph(int n){
        graph=new ArrayList[n];
        for(int i=0;i<n;i++){
            graph[i]=new ArrayList<>();
        }
    }
    static void addEdge(int a,int b){
        graph[a].add(new Pair(b,1));
    }
    static void addEdge(int a,int b,int c){
        graph[a].add(new Pair(b,c));
    }
/*********************************************PAIR********************************************************/
    static class PairComp implements Comparator<Pair>{
        public int compare(Pair p1,Pair p2){
            if(p1.u!=p2.u)
            return p1.u-p2.u;
            else
            return p1.v-p2.v;
        }
    }
    static class Pair implements Comparable<Pair> {
        int u;
        int v;
        int index=-1;
        public Pair(int u, int v) {
            this.u = u;
            this.v = v;
        }
        public int hashCode() {
            int hu = (int) (u ^ (u >>> 32));
            int hv = (int) (v ^ (v >>> 32));
            return 31 * hu + hv;
        }
        public boolean equals(Object o) {
            Pair other = (Pair) o;
            return u == other.u && v == other.v;
        }
        public int compareTo(Pair other) {
            if(index!=other.index)
                return Long.compare(index, other.index);
            return Long.compare(v, other.v)!=0?Long.compare(v, other.v):Long.compare(u, other.u);
        }
        public String toString() {
            return "[u=" + u + ", v=" + v + "]";
        }
    }
/******************************************Long Pair*******************************************************/
    static class PairCompL implements Comparator<Pairl>{
        public int compare(Pairl p1,Pairl p2){
            long a=p1.u*p2.v;
            long b=p2.u*p1.v;
            if(a>b){
                return -1;
            }
            else if(a<b){
                return 1;
            }
            else{
                return 0;
            }
        }
    }
    static class Pairl implements Comparable<Pairl> {
            long u;
            long v;
            int index=-1;
            public Pairl(long u, long v) {
                this.u = u;
                this.v = v;
            }

            public int hashCode() {
                int hu = (int) (u ^ (u >>> 32));
                int hv = (int) (v ^ (v >>> 32));
                return 31 * hu + hv;
            }

            public boolean equals(Object o) {
                Pairl other = (Pairl) o;
                return u == other.u && v == other.v;
            }

            public int compareTo(Pairl other) {
                if(index!=other.index)
                    return Long.compare(index, other.index);
                return Long.compare(v, other.v)!=0?Long.compare(v, other.v):Long.compare(u, other.u);
            }

            public String toString() {
                return "[u=" + u + ", v=" + v + "]";
            }
        }
/*****************************************DEBUG***********************************************************/
    public static void debug(Object... o) {
        if(!oj)
        System.out.println(Arrays.deepToString(o));
    }
/************************************MODULAR EXPONENTIATION***********************************************/
    static long modulo(long a,long b,long c) {
        long x=1;
        long y=a%c;
        while(b > 0){
            if(b%2 == 1){
                x=(x*y)%c;
            }
            y = (y*y)%c; // squaring the base
            b /= 2;
        }
        return  x%c;
    }
/********************************************GCD**********************************************************/
    static long gcd(long x, long y)
    {
        if(x==0)
            return y;
        if(y==0)
            return x;
        long r=0, a, b;
        a = (x > y) ? x : y; // a is greater number
        b = (x < y) ? x : y; // b is smaller number
        r = b;
        while(a % b != 0)
        {
            r = a % b;
            a = b;
            b = r;
        }
        return r;
    }
/******************************************SIEVE**********************************************************/
    static void sieveMake(int n){
        sieve=new boolean[n];
        Arrays.fill(sieve,true);
        sieve[0]=false;
        sieve[1]=false;
        for(int i=2;i*i<n;i++){
            if(sieve[i]){
                for(int j=i*i;j<n;j+=i){
                    sieve[j]=false;
                }
            }
        }
        primes=new ArrayList<Integer>();
        for(int i=0;i<n;i++){
            if(sieve[i]){
                primes.add(i);
            }
        }
    }
/********************************************End***********************************************************/
}

import java.util.*;
import java.time.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        final long mod = 1000000007L;
        int min = Math.min(n,m);
        int max = Math.max(n,m);
        long sum1 = 1;
        long sum2 = 1;
        long tmp;
        for (int i=0; i<min-1; i++) {
            tmp = sum2;
            sum2 += sum1;
            sum1 = tmp;
            sum1 %= mod;
            sum2 %= mod;
        }
        long s1 = sum2;
        for (int i=min-1; i<max-1; i++) {
            tmp = sum2;
            sum2 += sum1;
            sum1 = tmp;
            sum1 %= mod;
            sum2 %= mod;
        }
        long s2 = sum2;
        long result = 2*(s1+s2-1);
        result%=mod;
        System.out.println(result);
    }

}

import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static final long mod = (long) (1e9 + 7);

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[][] = new long[n][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < n; i++) {
            dp[i][0] = (dp[i - 1][0] + dp[i - 1][1])%mod;
            dp[i][1] = dp[i - 1][0];
        }
        long ans = (dp[n - 1][0] + dp[n - 1][1] - 1 + mod)%mod;
        ans = ans * 2;
        ans = ans%mod;
        dp = new long[m][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < m; i++) {
            dp[i][0] = (dp[i - 1][0] + dp[i - 1][1])%mod;
            dp[i][1] = dp[i - 1][0];
        }
        long ans2 = (dp[m - 1][0] + dp[m - 1][1] - 1 +mod)%mod;
        ans2 = ans2 * 2;
        ans2 = ans2%mod;
        pw.println((ans + ans2 + 2)%mod);
        pw.close();
    }
}

import java.util.*;
import java.io.*;

public class CF {

  static int n, m;
  static int mod=(int)1e9+7;
  static int ans[] = new int[100001];

  static void solve() {
    ans[0] =1 ;
    ans[1] =1 ;
    ans[2] =2;
    for (int i = 3; i < 100001; i++)
      ans[i] =( ans[i - 1] %mod + ans[i - 2] %mod) % mod;
  }

  public static void main(String[] arg) throws Exception{
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    String s[] = bf.readLine().trim().split("\\s+");
    n = Integer.parseInt(s[0]);
    m = Integer.parseInt(s[1]);
    solve();
    System.out.println((2 * ((ans[n] + ans[m] - 1)%mod))%mod);
  }
}

import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
	//static final long MOD = 998244353;
	static final long MOD = 1000000007;
	static final int INF = 1000000007;
	static boolean[] visited;
    public static void main(String[] args) throws IOException {
        FastScanner sc = new FastScanner();
        int N = sc.nextInt();
        int M = sc.nextInt();
        long[] fib = new long[100001];
        fib[0] = 1;
        fib[1] = 1;
        for (int i = 2; i <= 100000; i++)
        	fib[i] = (fib[i-1]+fib[i-2])%MOD;
        long ans = 2*(fib[N]+fib[M]-1 + MOD) % MOD;
        System.out.println(ans);
    }

    public static long power(long x, long y, long p) {
        // Initialize result
        long res = 1;

        // Update x if it is more
        // than or equal to p
        x = x % p;

        while (y > 0)
        {
            // If y is odd, multiply x
            // with result
            if((y & 1)==1)
                res = (res * x) % p;

            // y must be even now
            // y = y / 2
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }

    public static long dist(int[] point, int[] point2) {
    	return (long)(Math.pow((point2[1]-point[1]),2)+Math.pow((point2[0]-point[0]),2));
    }

    public static long gcd(long a, long b) {
    	if (b == 0)
    		return a;
    	else
    		return gcd(b,a%b);
    }

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  if (arr1[1] != arr2[1])
					  return arr1[1]-arr2[1];
				  else if (arr1[2] != arr2[2])
					  return arr1[2]-arr2[2];
				  else
					  return arr1[3]-arr2[3];
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}
class Node {
	public HashSet<Node> children;
	public int n;

	public Node(int n) {
		this.n = n;
		children = new HashSet<Node>();
	}

	public void addChild(Node node) {
		children.add(node);
	}

	public void removeChild(Node node) {
		children.remove(node);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return n;
	}

	@Override
	public boolean equals(Object obj) {
		if (! (obj instanceof Node)) {
			return false;
		} else {
			Node node = (Node) obj;
			return (n == node.n);
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * Created by Katushka on 20.10.2019.
 */
public class IvanTheFoolProbability {

    final static long MOD = 1000000007;

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n1 = in.nextInt();
        int m1 = in.nextInt();

        int n = Math.min(n1, m1);
        int m = Math.max(n1, m1);

        if (n == 1 && m == 1) {
            System.out.println(2);
            return;
        }

        long[][] firstRowDP = new long[m][4];
        firstRowDP[1][0] = 1;
        firstRowDP[1][1] = 1;
        firstRowDP[1][2] = 1;
        firstRowDP[1][3] = 1;

        for (int i = 2; i < m; i++) {
            firstRowDP[i][0] = firstRowDP[i - 1][2];
            firstRowDP[i][1] = (firstRowDP[i - 1][0] + firstRowDP[i - 1][2]) % MOD;
            firstRowDP[i][2] = (firstRowDP[i - 1][1] + firstRowDP[i - 1][3]) % MOD;
            firstRowDP[i][3] = firstRowDP[i - 1][1];
        }

        long rows = (firstRowDP[m - 1][0] + firstRowDP[m - 1][1] + firstRowDP[m - 1][2] + firstRowDP[m - 1][3]) % MOD;

        if (n == 1) {
            System.out.println(rows);
            return;
        }

        long[][] firstColDP = new long[n][4];
        firstColDP[1][0] = 1;
        firstColDP[1][1] = 1;
        firstColDP[1][2] = 1;
        firstColDP[1][3] = 1;

        for (int i = 2; i < n; i++) {
            firstColDP[i][0] = firstColDP[i - 1][2];
            firstColDP[i][1] = (firstColDP[i - 1][0] + firstColDP[i - 1][2]) % MOD;
            firstColDP[i][2] = (firstColDP[i - 1][1] + firstColDP[i - 1][3]) % MOD;
            firstColDP[i][3] = firstColDP[i - 1][1];
        }

        long cols = (firstColDP[n - 1][0] + firstColDP[n - 1][1] + firstColDP[n - 1][2] + firstColDP[n - 1][3]) % MOD;

        System.out.println((rows + cols - 2) % MOD);

    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    final String str = reader.readLine();
                    tokenizer = new StringTokenizer(str);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }
    }
}

import java.util.Scanner;

public class Main {
	public static int maxn=100010,n,m,mod=1000000007;
	public static long ans=0;
    public static long fib(int n) {
        if(n < 2)
            return n;
        long f = 0, g = 1;
        long result = 0;
        for(int i = 1; i < n; i++){
            result = f + g;
            result%=mod;
            f = g;
            g = result;
        }
        return result;
    }
		public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		n=sc.nextInt()+1;
		m=sc.nextInt()+1;
		System.out.println((long)((fib(n)+fib(m)-1)*2)%1000000007);
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.math.BigInteger;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader sc = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, sc, out);
        out.close();
    }

    static class Task {
    	public static final long Mod=(long) (1e9+7);
    	public static final int Max=(int) 1e6;

    	public long quickPow(long x,long y) {
    		long res=1;

    		while(y>0) {
    			if((y&1)==1)
    				res=res*x%Mod;
    			x=x*x%Mod;
    			y>>=1;
    		}

    		return res;
    	}

        public void solve(int testNumber, InputReader sc, PrintWriter out) throws IOException {
        	int n=sc.nextInt();
        	int m=sc.nextInt();
        	long[] f=new long[Max];
        	long[] s=new long[Max];
        	f[1]=2;
        	f[2]=4;

        	for(int i=3;i<Max;i++) {
        		f[i]=(f[i-1]+f[i-2])%Mod;
        	}
        	long[] buf=new long[Max];
        	buf[1]=2;
        	buf[2]=2;
        	s[1]=2;
        	s[2]=4;
        	for(int i=3;i<Max;i++) {
        		buf[i]=(buf[i-1]+buf[i-2])%Mod;
        		s[i]=(s[i-1]+buf[i])%Mod;
        	}
        	long ans=(f[n]+s[m-1])%Mod;
        	out.println(ans);
        }
    }

    static class InputReader{
        StreamTokenizer tokenizer;
        public InputReader(InputStream stream){
            tokenizer=new StreamTokenizer(new BufferedReader(new InputStreamReader(stream)));
            tokenizer.ordinaryChars(33,126);
            tokenizer.wordChars(33,126);
        }
        public String next() throws IOException {
            tokenizer.nextToken();
            return tokenizer.sval;
        }
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
        public boolean hasNext() throws IOException {
            int res=tokenizer.nextToken();
            tokenizer.pushBack();
            return res!=tokenizer.TT_EOF;
        }

        public double nextDouble() throws NumberFormatException, IOException {
        	return Double.parseDouble(next());
        }

        public BigInteger nextBigInteger() throws IOException {
        	return new BigInteger(next());
        }
    }
}

import java.io.*;
import java.nio.CharBuffer;
import java.util.NoSuchElementException;

public class P1248C {

    private static final long MOD = 1_000_000_007;

    public static void main(String[] args) {
        SimpleScanner scanner = new SimpleScanner(System.in);
        PrintWriter writer = new PrintWriter(System.out);

        int n = scanner.nextInt();
        int m = scanner.nextInt();
        Matrix fibInit = new Matrix(new long[][]{{2, 1}});
        Matrix fibTrans = new Matrix(new long[][]{
                {1, 1},
                {1, 0},
        });
        fibTrans = fibTrans.pow(n - 1);
        Matrix subInit = new Matrix(new long[][]{{1, 0, 1}});
        Matrix subTrans = new Matrix(new long[][]{
                {1, 1, 0},
                {1, 0, 0},
                {1, 0, 1}
        });
        subTrans = subTrans.pow(n - 1);
        long a = fibInit.multiply(fibTrans).matrix[0][1];
        long b = (a + 1) % MOD;
        long sub = subInit.multiply(subTrans).matrix[0][1];
        Matrix rowInit = new Matrix(new long[][]{{b, a, sub}});
        Matrix rowTrans = new Matrix(new long[][]{
                {1, 1, 0},
                {1, 0, 0},
                {-1, 0, 1}
        });
        rowTrans = rowTrans.pow(m - 1);
        writer.println(2 * rowInit.multiply(rowTrans).matrix[0][1] % MOD);

        writer.close();
    }

    private static class Matrix {
        private int m, n;
        private long[][] matrix;

        Matrix(int m, int n) {
            if (m <= 0 || n <= 0)
                throw new IllegalArgumentException();
            this.m = m;
            this.n = n;
            this.matrix = new long[m][n];
        }

        Matrix(long[][] matrix) {
            if (matrix.length <= 0)
                throw new IllegalArgumentException();
            for (long[] row : matrix)
                if (row.length != matrix[0].length)
                    throw new IllegalArgumentException();
            this.matrix = matrix;
            this.m = matrix.length;
            this.n = matrix[0].length;
        }

        Matrix multiply(Matrix other) {
            if (other.m != this.n)
                throw new IllegalArgumentException();
            long[][] t = new long[this.m][other.n];
            for (int i = 0; i < this.m; ++i)
                for (int j = 0; j < other.n; ++j)
                    for (int k = 0; k < this.n; ++k) {
                        t[i][j] = (t[i][j] + this.matrix[i][k] * other.matrix[k][j] % MOD + MOD) % MOD;
                    }
            return new Matrix(t);
        }

        Matrix pow(long k) {
            if (this.m != this.n)
                throw new UnsupportedOperationException();
            Matrix t = new Matrix(n, n), temp = this;
            for (int i = 0; i < n; ++i)
                t.matrix[i][i] = 1;
            for (int i = 0; (1L << i) <= k; ++i) {
                if (((1L << i) & k) > 0) {
                    t = t.multiply(temp);
                }
                temp = temp.multiply(temp);
            }
            return t;
        }
    }

    private static class SimpleScanner {

        private static final int BUFFER_SIZE = 10240;

        private Readable in;
        private CharBuffer buffer;
        private boolean eof;

        private SimpleScanner(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
            buffer = CharBuffer.allocate(BUFFER_SIZE);
            buffer.limit(0);
            eof = false;
        }

        private char read() {
            if (!buffer.hasRemaining()) {
                buffer.clear();
                int n;
                try {
                    n = in.read(buffer);
                } catch (IOException e) {
                    n = -1;
                }
                if (n <= 0) {
                    eof = true;
                    return '\0';
                }
                buffer.flip();
            }
            return buffer.get();
        }

        private void checkEof() {
            if (eof)
                throw new NoSuchElementException();
        }

        private char nextChar() {
            checkEof();
            char b = read();
            checkEof();
            return b;
        }

        private String next() {
            char b;
            do {
                b = read();
                checkEof();
            } while (Character.isWhitespace(b));
            StringBuilder sb = new StringBuilder();
            do {
                sb.append(b);
                b = read();
            } while (!eof && !Character.isWhitespace(b));
            return sb.toString();
        }

        private int nextInt() {
            return Integer.parseInt(next());
        }

        private long nextLong() {
            return Long.parseLong(next());
        }

        private double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.lang.*;
import java.util.*;
import java.io.*;

public class Main {
    void solve(){
         int n=ni(),m=ni();
         long f[]=new long[100001];
         f[1]=2;
         f[2]=2;
         for(int i=3;i<=100000;i++) f[i]=add(f[i-1],f[i-2]);
         long pref[]=new long[100001];
         for(int i=1;i<=100000;i++) pref[i]=add(pref[i-1],f[i]);
         long ans=2;
         ans=add(ans,pref[n-1]);
         ans=add(ans,pref[m-1]);
         pw.println(ans);

    }
    long add(long a,long b){
        a+=b;
        if(a>=M) a-=M;
        return a;
    }
    int a[][];
    long go(int i,int j,int n,int m){

        if(j>m){
            i++;
            j=1;
        }
        if(i>n){
            for(int ii=1;ii<=n;ii++){
                for(int jj=1;jj<=m;jj++){
                    int cc=0;
                    if(ii-1>=1) {
                        if(a[ii-1][jj]==a[ii][jj])cc++;
                    }
                    if(ii+1<=n){
                        if(a[ii+1][jj]==a[ii][jj]) cc++;
                    }
                    if(jj-1>=1){
                        if(a[ii][jj-1]==a[ii][jj]) cc++;
                    }
                    if(jj+1<=m) if(a[ii][jj+1]==a[ii][jj]) cc++;
                    if(cc>1) return 0;
                }
            }
            return 1;

        }
        long ans=0;
        if(i-1>=1 && j-1>=1){
            if(a[i-1][j]==a[i][j-1]){
                a[i][j]=a[i-1][j]^1;
                ans+=go(i,j+1,n,m);
            }else {
                a[i][j]=0;
                ans+=go(i,j+1,n,m);
                a[i][j]=1;
                ans+=go(i,j+1,n,m);
            }
        }else {
            a[i][j]=0;
            ans+=go(i,j+1,n,m);
            a[i][j]=1;
            ans+=go(i,j+1,n,m);
        }

        return ans;

    }

    long M = (long)1e9+7;
    // END
    PrintWriter pw;
    StringTokenizer st;
    BufferedReader br;

    void run() throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
    }
    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    String ns() {
        while (st == null || !st.hasMoreElements()) {

            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    String nextLine() throws Exception {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            throw new Exception(e.toString());
        }
        return str;
    }

    int ni() {
        return Integer.parseInt(ns());
    }

    long nl() {
        return Long.parseLong(ns());
    }

    double nd() {
        return Double.parseDouble(ns());
    }
}

import java.io.PrintWriter;
import java.util.*;

public class Main {
    private static int mod = 1_000_000_007;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
       int n, m;
       n = in.nextInt();
       m = in.nextInt();
       int[] f = new int[Math.max(n, m) + 1];
       f[0] = 1;
       f[1] = 1;
       for (int i = 2; i < f.length; i++) {
           f[i] = f[i - 1] + f[i - 2];
           f[i] %= mod;
       }
       out.println((2 * (f[n] + f[m] - 1) % mod) % mod);
       out.close();
    }
}

import java.util.Scanner;

public class C {
	//思维题   斐波那契
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int []arr=new int[100001];
		arr[0]=1;arr[1]=1;
		for(int i=2;i<100001;i++) {
			arr[i]=arr[i-1]+arr[i-2];
			arr[i]=arr[i]%1000000007;
		}
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int m=in.nextInt();
		System.out.println(2*(arr[n]+arr[m]-1)%1000000007);
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class contest {
	static long A = 1000000000+7;
	static long[] fib = new long[100002];
	public static long fib(int n) {
		if(n<0)return 0;
		if(fib[n]!=0)return fib[n];
		fib[0]=1;
		fib[1]=2;
		fib[2]=4;
		for(int i=3;i<=n;i++) {
			fib[i]=(2*(fib[i-2]%A+fib[i-3]%A)%A)%A;
		}
		return fib[n];
	}
	public static long f(int n ,int m) {
		if(n==1) {
			return fib(m);
		}else if(m==1)
			return fib(n);
		long r;
		 r = 2*(fib(n-2)%A+fib(n-3)%A)%A;
		r%=A;
		long r2 = 2*(fib(m-2)%A+fib(m-3)%A)%A;
		r2%=A;
		r = (r+r2)%A;
		return r;
	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		System.out.println(f(sc.nextInt(),sc.nextInt()));
		pw.flush();
		pw.close();
	}

}

import java.io.*;
import java.util.*;

public class Main {
    static int inf = (int) 1e9 + 7;

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(System.out);
        int n = nextInt();
        int m = nextInt();
        int ans1 = 1;
        for(int i = 0;i < n - 2;i++) {
            ans1 = (ans1 * 2) % inf;
        }
        int ans2 = 1;
        for(int i = 0;i < m - 2;i++) {
            ans2 = (ans2 * 2) % inf;
        }
        int ans3 = (ans1 + ans2 + 1) % inf;
        pw.println(ans3 * 2 % inf);
        pw.close();
    }

    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");
    static PrintWriter pw;

    static String next() throws IOException {
        while (!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

}

import java.util.*;

public class IvanTheFool2 {

	static int MOD = 1000000007;

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] arr = new int[100000];
		arr[0] = 2;
		arr[1] = 4;
		for (int i = 2; i < arr.length; i++) {
			arr[i] = arr[i - 1] + arr[i - 2];
			arr[i] = arr[i] % MOD;
		}

		long sol=((arr[m-1]+arr[n-1])%MOD -2)%MOD;

		System.out.println(sol);

	}

}

import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    static long inf = Long.MAX_VALUE / 2;
    static int mod = (int) 1e9 + 7;

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        int n = nextInt();
        int m = nextInt();
        long[] dp = new long[100002];
        dp[0] = 1;
        dp[1] = 1;
        for (int i = 2; i < 100002; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        out.print(2 * (dp[n] + dp[m] - 1));
        out.close();
    }

    static PrintWriter out;
    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static String next() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}

import java.util.*;

public class IvanTheFool {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();

		long ans = 1;

		if (n == 1 || m == 1) {
			if (n == 1) {
				ans = m * 2;
			} else {
				ans = n * 2;
			}
		} else {

			ans=(m*n)%1000000007;
			ans=ans+Math.min(m, n);
		}
		ans=ans%1000000007;
		System.out.println(ans);

	}

}

import java.io.*;
import java.util.*;

public class main {
	static final int MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());

		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		long ans = n*2;
		ans %= MOD;
		ans += (m-1)*2;
		ans %= MOD;
		System.out.println(ans);
	}
}

import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main
{
   static long mod=(long)(1e+9 + 7);
   //static long mod=(long)998244353;

   static int[] sieve;
   static ArrayList<Integer> primes;
   static long min=Long.MAX_VALUE;

   public static void main(String[] args) throws java.lang.Exception
   {
	     fast s = new fast();
	     PrintWriter out=new PrintWriter(System.out);

	     int t=1;
	     StringBuilder fans=new StringBuilder("");

	     while(t>0)
	    	 {
	    		 long f[]=new long[100005];

	    	    int n=s.nextInt();
	    	    int m=s.nextInt();

	    	    f[1]=2;
	    	    f[2]=4;

	    	    for(int i=3;i<=Math.max(n, m);i++) f[i]=(f[i-1]+f[i-2])%mod;
	    	    System.out.println(f[n]+f[m]-2);
	    		 t--;
	    	 }
   }

static class fast {
	    private InputStream i;
		private byte[]  buf = new byte[1024];
		private int curChar;

		private int numChars;

		//Return floor log2n
		public static long log2(long bits) // returns 0 for bits=0
			{
			    int log = 0;
			    if( ( bits & 0xffff0000 ) != 0 ) { bits >>>= 16; log = 16; }
			    if( bits >= 256 ) { bits >>>= 8; log += 8; }
			    if( bits >= 16  ) { bits >>>= 4; log += 4; }
			    if( bits >= 4   ) { bits >>>= 2; log += 2; }
			    return log + ( bits >>> 1 );
			}

		public static boolean next_permutation(int a[])
		   {
			   int i=0,j=0;int index=-1;
			   int n=a.length;

			   for(i=0;i<n-1;i++)
				   if(a[i]<a[i+1]) index=i;

			   if(index==-1) return false;
			   i=index;

			   for(j=i+1;j<n && a[i]<a[j];j++);

			   int temp=a[i];
			   a[i]=a[j-1];
			   a[j-1]=temp;

			   for(int p=i+1,q=n-1;p<q;p++,q--)
			   {
				   temp=a[p];
				   a[p]=a[q];
				   a[q]=temp;
			   }

			   return true;
		   }

		public static void division(char ch[],int divisor)
		   {
			   int div=Character.getNumericValue(ch[0]); int mul=10;int remainder=0;
			   StringBuilder quotient=new StringBuilder("");
			   for(int i=1;i<ch.length;i++)
			   {
				   div=div*mul+Character.getNumericValue(ch[i]);
				   if(div<divisor) {quotient.append("0");continue;}
				   quotient.append(div/divisor);
				   div=div%divisor;mul=10;

			   }
			   remainder=div;
			   while(quotient.charAt(0)=='0')quotient.deleteCharAt(0);
			   System.out.println(quotient+" "+remainder);
		   }

		public static void sieve(int size)
		{
			sieve=new int[size+1];

			primes=new ArrayList<Integer>();

			sieve[1]=1;

			for(int i=2;i*i<=size;i++)
			{
				if(sieve[i]==0)
				 {
					for(int j=i*i;j<size;j+=i) {sieve[j]=1;}
				 }
			}

			for(int i=2;i<=size;i++)
			{
				if(sieve[i]==0) primes.add(i);
			}
		}

		public static long pow(long n, long b, long MOD)
		   {
		       long x=1;long y=n;
		       while(b > 0)
		       {
		           if(b%2 == 1)
		           {
		               x=x*y;
		               if(x>MOD) x=x%(MOD);
		           }
		           y = y*y;
		           if(y>MOD) y=y%(MOD);
		           b >>= 1;
		       }
		       return x;
		   }

		public static long mod_inv(long n,long mod)
		{
			return pow(n,mod-2,mod);
		}

		//Returns index of highest number less than or equal to key
		 public static int upper(long[] a,int length,long key)
		 {
			    int low = 0;
		        int high = length-1;
		        int ans=-1;

		        while (low <= high) {
		            int mid = (low + high) / 2;
		            if (key >= a[mid]) {
		                ans=mid;
		            	low = mid+1;
		            } else if(a[mid]>key){
		                high = mid - 1;
		            }
		        }
		        return ans;
		}

		//Returns index of least number greater than or equal to key
		 public static int lower(long[] a,int length,long key)
		 {
			    int low = 0;
		        int high = length-1;
		        int ans=-1;

		        while (low <= high) {
		            int mid = (low + high) / 2;
		            if (key<=a[mid]) {
		                ans=mid;
		            	high = mid-1;
		            }
		            else{
		            		low=mid+1;
		            	}
		        }
		        return ans;
		}

		public long gcd(long r,long ans)
		{
			if(r==0) return ans;
			return gcd(ans%r,r);
		}
		public fast() {
			this(System.in);
		}
		public fast(InputStream is) {
			i = is;
		}
		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = i.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}
		public String nextString() {
     		int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
		public boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}
}

import java.util.*;
import java.io.*;

public class ProbTheory {
    final static long MODULO = (long)(1e9+7);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("ProbTheory.out");

        int n = sc.nextInt();
        int m = sc.nextInt();

        long a = 1;
        long b = 1;
        long ans = 1;
        long endAns = 0;

        for(int i = 1; i<=Math.max(n,m); i++){
            if(i == n && n == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            else if(i == n || i == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            ans = ((a % MODULO) + (b % MODULO)) % MODULO;
            a = b;
            b = ans;
        }
        endAns--;
        endAns = ((endAns % MODULO) * 2) % MODULO;

        System.out.println(endAns);

    }
}

//package div3;

import java.io.*;
import java.util.List;
import java.util.StringTokenizer;

public class board
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    static void print(List<Integer> l){
        for(int ele:l){
            System.out.print(ele+" ");
        }
        System.out.println();
    }
    static Integer[][][] dp;
    static int mod = (int)(1e9+7);
    static int add(int a,int b){
        return (a%mod+b%mod)%mod;
    }
    static int mul(int a,int b){
        return (a%mod * b%mod)%mod;
    }
    private static int go(int blacks,int whites,int index,int m){
        if(index >= m)return 1;
        if(dp[index][blacks][whites] != null)return dp[index][blacks][whites];
        int count = 0;
        //System.out.println(blacks+" "+whites);
        if(blacks >= 2){
            count = add(count,go(0,1,index+1,m));
        }
        else if(whites >= 2){
            count = add(count,go(1,0,index+1,m));
        }
        else{
            count = add(go(blacks+1,0,index+1,m) , go(0,whites+1,index+1,m));
        }

        return dp[index][blacks][whites] = count;
    }
    public static void main(String[] args)
    {
        FastReader sc=new FastReader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        //int t  = sc.nextInt();

        int n = sc.nextInt();
        int m = sc.nextInt();
        dp = new Integer[m][4][4];
        int[] pow = new int[n+1];
        int[] cal = new int[m+1];

        cal[1] = 2;
        if(m>=2)
        cal[2] = 4;
        for(int i=3;i<=m;i++){
            cal[i] = add(cal[i-1],cal[i-2]);
        }
        pow[0] = 1;
        for(int i=1;i<=n;i++){
            pow[i] = mul(pow[i-1],2);
        }
        int ways = cal[m];
        //System.out.println(go(0,0,0,m));
        //System.out.println(ways+" "+pow[n]);
        System.out.println((ways-2) + (pow[n]));

        //out.close();

    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
//import java.math.*;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */

public class Main {

	static int MD= 1000000007;
    public static void main(String[] args) throws IOException {
    	OutputStream outputStream = System.out;
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {

        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
        	int t=1;
        	long[] a=new long[100001];
        	a[0]=1;
        	a[1]=1;
        	for(int i=2;i<=100000;i++) {
        		a[i]=a[i-1]+a[i-2];
        	}
        	while(t-->0) {
        		int n=in.nextInt();
        		int m=in.nextInt();
        		long ans=(a[n]+a[m])%MD;
        		ans*=2;
        		ans%=MD;
        		ans-=2;

        		out.println(ans);

        	}

        }

    }

    static class InputReader
    {
        BufferedReader br;
        StringTokenizer st;

        public InputReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }

    }
    static void sort(int[] a, int low, int high)
    {
        int N = high - low;
        if (N <= 1)
            return;
        int mid = low + N/2;
        sort(a, low, mid);
        sort(a, mid, high);
        int[] temp = new int[N];
        int i = low, j = mid;
        for (int k = 0; k < N; k++)
        {
            if (i == mid)
                temp[k] = a[j++];
            else if (j == high)
                temp[k] = a[i++];
            else if (a[j]<a[i])
                temp[k] = a[j++];
            else
                temp[k] = a[i++];
        }
        for (int k = 0; k < N; k++)
            a[low + k] = temp[k];
    }
    public static long fexp(long x, long y, long p) {
        long res = 1;

        x = x % p;

        while (y > 0)
        {

            if((y & 1)==1)
                res = (res * x) % p;

            y = y >> 1;
            x = (x * x) % p;
        }
        return res;

    }
    static int gcd(int a, int b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);

    }

}

/**
 * @author Juan Sebastian Beltran Rojas
 * @mail jsbeltran.valhalla@gmail.com
 * @veredict
 * @url
 * @category
 * @date
 **/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

public class CF1239A {
    static long MOD = 1000000007;
    static int N, M;
    static long[] mem;

    public static void main(String args[]) throws Throwable {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for (String ln; (ln = in.readLine()) != null; ) {
            StringTokenizer st = new StringTokenizer(ln);
            N = parseInt(st.nextToken());
            M = parseInt(st.nextToken());
            mem = new long[Math.max(M,N)+1];
            System.out.println(2*f(N)+2*f(M)-2);
        }
    }

    static long f(int p) {
        if (p == 0) return 1;
        if (p <0) return 0;
        if(mem[p]>0)return mem[p];
        return mem[p]=(f(p - 1) + f(p - 2)) % MOD;
    }
}

import java.io.*;
import java.util.StringTokenizer;
public class CF1239A {
    static int MOD=1000000007;
    public static void main(String[] args) throws IOException {
         long[] fib=new long[1000001];
         fib[0]=1;
         fib[1]=2;
         fib[2]=3;
         for (int i = 3; i < 1000001; i++) {
            fib[i]=(fib[i-1]+fib[i-2])%MOD;
        }
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());

        int M=Integer.parseInt(st.nextToken());
        int N=Integer.parseInt(st.nextToken());
        int ans=2;
        for (int i = 0; i <= N-3; i++) {
            ans+=fib[i]; ans%=MOD;
        }
        for (int i = 0; i <= M-3; i++) {
            ans+=fib[i]; ans%=MOD;
        }
        ans*=2; ans%=MOD; ans+=2; ans%=MOD;
        System.out.println(ans);
    }

}

import java.io.*;
import java.util.*;
public class Main {
    public static void main(String args[])
    {
        FastReader input=new FastReader();
        PrintWriter out=new PrintWriter(System.out);
        int T=1;
        while(T-->0)
        {
            long n=input.nextInt();
            long m=input.nextInt();
            long mod=1000000007;
            long a[]=new long[100001];
            a[2]=2;
            a[3]=2;
            long x=2;
            for(int i=1;i<=m;i++)
            {
                if(i>3)
                {
                    a[i]=a[i-1]+a[i-2];
                }
                x=(x%mod+a[i]%mod)%mod;
            }
            a=new long[100001];
            a[2]=2;
            a[3]=2;
            for(int i=1;i<=n;i++)
            {
                if(i>3)
                {
                    a[i]=a[i-1]+a[i-2];
                }
                x=(x%mod+a[i]%mod)%mod;
            }
            out.println(x);
        }
        out.close();
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * Created by Katushka on 20.10.2019.
 */
public class IvanTheFoolProbability {

    final static long MOD = 1000000007;

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n1 = in.nextInt();
        int m1 = in.nextInt();

        int n = Math.min(n1, m1);
        int m = Math.max(n1, m1);

        if (n == 1 && m == 1) {
            System.out.println(2);
            return;
        }

        long[][] firstRowDP = new long[m][4];
        firstRowDP[1][0] = 1;
        firstRowDP[1][1] = 1;
        firstRowDP[1][2] = 1;
        firstRowDP[1][3] = 1;

        for (int i = 2; i < m; i++) {
            firstRowDP[i][0] = firstRowDP[i - 1][2];
            firstRowDP[i][1] = (firstRowDP[i - 1][0] + firstRowDP[i - 1][2]) % MOD;
            firstRowDP[i][2] = (firstRowDP[i - 1][1] + firstRowDP[i - 1][3]) % MOD;
            firstRowDP[i][3] = firstRowDP[i - 1][1];
        }

        long rows = (firstRowDP[m - 1][0] + firstRowDP[m - 1][1] + firstRowDP[m - 1][2] + firstRowDP[m - 1][3]) % MOD;

        if (n == 1) {
            System.out.println(rows);
            return;
        }

        long[][] firstColDP = new long[n][4];
        firstColDP[1][0] = 1;
        firstColDP[1][1] = 1;
        firstColDP[1][2] = 1;
        firstColDP[1][3] = 1;

        for (int i = 2; i < n; i++) {
            firstColDP[i][0] = firstColDP[i - 1][2];
            firstColDP[i][1] = (firstColDP[i - 1][0] + firstColDP[i - 1][2]) % MOD;
            firstColDP[i][2] = (firstColDP[i - 1][1] + firstColDP[i - 1][3]) % MOD;
            firstColDP[i][3] = firstColDP[i - 1][1];
        }

        long cols = (firstColDP[n - 1][0] + firstColDP[n - 1][1] + firstColDP[n - 1][2] + firstColDP[n - 1][3]) % MOD;

        System.out.println(rows + cols - 2);

    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    final String str = reader.readLine();
                    tokenizer = new StringTokenizer(str);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }
    }
}

/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
*/
import java.util.*;
import java.io.*;

   public class C
   {
      public static void main(String args[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int M = Integer.parseInt(st.nextToken());
         long res = 0L;
         long[] fac = new long[100001];
         long MOD = 1000000007L;
         //factorials
         fac[0] = 1;
         fac[1] = 1;
         for(int i=2; i < fac.length; i++)
            fac[i] = (fac[i-1]*i)%MOD;
         //bar from N
         for(int i=0; i <= N/2; i++)
         {
            long permute = i+1;
            if(i*2 == N) //no checkerboard
               permute = 1;
            res += 2*permute;
            res %= MOD;
         }
         //from M
         for(int i=0; i <= M/2; i++)
         {
            long permute = i+1;
            if(i*2 == M)
               permute = 1;
            res += 2*permute;
            res %= MOD;
         }
         res -= 2;
         System.out.println(res%MOD);
      }
      public static long power(long x, long y, long p)
       {
           // Initialize result
           long res = 1L;

           // Update x if it is more
           // than or equal to p
           x = x % p;

           while (y > 0)
           {
               // If y is odd, multiply x
               // with result
               if((y & 1)==1)
                   res = (res * x) % p;

               // y must be even now
               // y = y / 2
               y = y >> 1;
               x = (x * x) % p;
           }
           return res;
       }
    }

import java.util.*;

public class IvanTheFool {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();

		long[] arr = new long[m];

		arr[0] = 2;
		if (m > 1) {
			arr[1] = 4;
		}

		for (int i = 2; i < arr.length; i++) {
			arr[i] = arr[i - 1] + arr[i - 2];
			arr[i] = arr[i] % 1000000007;
		}

		long ans = arr[arr.length - 1];
		long ans2 = (n - 1) * 2;
		ans = (ans + ans2) % 1000000007;
		System.out.println(ans);
	}

}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class Pair<A, B> {
	A first;
	B second;

	Pair(A first, B second) {
		this.first = first;
		this.second = second;
	}

}

class TaskB {
	long INF = (long) 1e18 + 5;
	long mod = (long) 1e9 + 7;

	public void solve(int testNumber, InputReader in, PrintWriter pw) {
		int N = in.nextInt();
		int M = in.nextInt();
		long ans = -2;
		ans += fib(N);
		ans += fib(M);
		pw.println(ans);
//
//		for (int i = 0; i < N; i++) {
//			pw.println(Arrays.toString(dp[i]));
//		}
	}

	long fib(int N) {
		long fib[] = new long[N + 1];
		fib[1] = 0;
		fib[2] = 1;
		for (int i = 3; i <= N; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
		}
		return fib[N];
	}

	long sum(int i, int j, long arr[]) {
		long sum = 0;
		for (int k = i; k <= j; k++) {
			sum += arr[k];
		}
		return sum;
	}

	boolean FirstRow_Col(Pair<Integer, Integer> pair) {
		return pair.first == 0 || pair.second == 0;
	}

	int __gcd(int a, int b) {
		if (b == 0)
			return a;
		return __gcd(b, a % b);

	}

	public int getInt(int num) {
		int ret = -1;
		switch (num) {
		case 0:
			ret = 6;
			break;
		case 1:
			ret = 2;
			break;
		case 2:
			ret = 5;
			break;
		case 3:
			ret = 5;
			break;
		case 4:
			ret = 4;
			break;
		case 5:
			ret = 5;
			break;
		case 6:
			ret = 6;
			break;
		case 7:
			ret = 3;
			break;
		case 8:
			ret = 7;
			break;
		case 9:
			ret = 6;
			break;
		}
		return ret;
	}

	public int isPow(long num) {
		int count = 0;
		while (num > 0) {
			num /= 2;
			count++;
		}
		return count;
	}
}

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

import java.util.*;
import java.io.*;

public class Main {

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public float nextFloat() {
            return Float.parseFloat(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] intArray = new int[n];
            for (int i = 0; i < n; i++) {
                intArray[i] = nextInt();
            }
            return intArray;
        }
    }

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        int q = 1;
        for (int i = 0; i < q; i++) {
            solver.solve(i + 1, in, out);
        }
        out.close();
    }

    static class Task {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            if (n < m) {
                n ^= m;
                m ^= n;
                n ^= m;
            }
            int[] F = new int[n + 2];
            F[0] = 0;
            F[1] = 1;
            for (int i = 2; i < n + 2; i++) {
                F[i] = F[i - 1] + F[i - 2];
            }
            out.println(2 * (F[n + 1] + F[m + 1] - 1));
        }
    }
}

import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main
{
   //static long mod=(long)(1e+9 + 7);
   static long mod=(long)998244353;

   static int[] sieve;
   static ArrayList<Integer> primes;
   static long min=Long.MAX_VALUE;

   public static void main(String[] args) throws java.lang.Exception
   {
	     fast s = new fast();
	     PrintWriter out=new PrintWriter(System.out);

	     int t=1;
	     StringBuilder fans=new StringBuilder("");

	     while(t>0)
	    	 {
	    		 long f[]=new long[1000005];

	    	    int n=s.nextInt();
	    	    int m=s.nextInt();

	    	    f[1]=2;
	    	    f[2]=4;

	    	    for(int i=3;i<=Math.max(n, m);i++) f[i]=(f[i-1]+f[i-2])%mod;
	    	    System.out.println(f[n]+f[m]-2);
	    		 t--;
	    	 }
   }

static class fast {
	    private InputStream i;
		private byte[]  buf = new byte[1024];
		private int curChar;

		private int numChars;

		//Return floor log2n
		public static long log2(long bits) // returns 0 for bits=0
			{
			    int log = 0;
			    if( ( bits & 0xffff0000 ) != 0 ) { bits >>>= 16; log = 16; }
			    if( bits >= 256 ) { bits >>>= 8; log += 8; }
			    if( bits >= 16  ) { bits >>>= 4; log += 4; }
			    if( bits >= 4   ) { bits >>>= 2; log += 2; }
			    return log + ( bits >>> 1 );
			}

		public static boolean next_permutation(int a[])
		   {
			   int i=0,j=0;int index=-1;
			   int n=a.length;

			   for(i=0;i<n-1;i++)
				   if(a[i]<a[i+1]) index=i;

			   if(index==-1) return false;
			   i=index;

			   for(j=i+1;j<n && a[i]<a[j];j++);

			   int temp=a[i];
			   a[i]=a[j-1];
			   a[j-1]=temp;

			   for(int p=i+1,q=n-1;p<q;p++,q--)
			   {
				   temp=a[p];
				   a[p]=a[q];
				   a[q]=temp;
			   }

			   return true;
		   }

		public static void division(char ch[],int divisor)
		   {
			   int div=Character.getNumericValue(ch[0]); int mul=10;int remainder=0;
			   StringBuilder quotient=new StringBuilder("");
			   for(int i=1;i<ch.length;i++)
			   {
				   div=div*mul+Character.getNumericValue(ch[i]);
				   if(div<divisor) {quotient.append("0");continue;}
				   quotient.append(div/divisor);
				   div=div%divisor;mul=10;

			   }
			   remainder=div;
			   while(quotient.charAt(0)=='0')quotient.deleteCharAt(0);
			   System.out.println(quotient+" "+remainder);
		   }

		public static void sieve(int size)
		{
			sieve=new int[size+1];

			primes=new ArrayList<Integer>();

			sieve[1]=1;

			for(int i=2;i*i<=size;i++)
			{
				if(sieve[i]==0)
				 {
					for(int j=i*i;j<size;j+=i) {sieve[j]=1;}
				 }
			}

			for(int i=2;i<=size;i++)
			{
				if(sieve[i]==0) primes.add(i);
			}
		}

		public static long pow(long n, long b, long MOD)
		   {
		       long x=1;long y=n;
		       while(b > 0)
		       {
		           if(b%2 == 1)
		           {
		               x=x*y;
		               if(x>MOD) x=x%(MOD);
		           }
		           y = y*y;
		           if(y>MOD) y=y%(MOD);
		           b >>= 1;
		       }
		       return x;
		   }

		public static long mod_inv(long n,long mod)
		{
			return pow(n,mod-2,mod);
		}

		//Returns index of highest number less than or equal to key
		 public static int upper(long[] a,int length,long key)
		 {
			    int low = 0;
		        int high = length-1;
		        int ans=-1;

		        while (low <= high) {
		            int mid = (low + high) / 2;
		            if (key >= a[mid]) {
		                ans=mid;
		            	low = mid+1;
		            } else if(a[mid]>key){
		                high = mid - 1;
		            }
		        }
		        return ans;
		}

		//Returns index of least number greater than or equal to key
		 public static int lower(long[] a,int length,long key)
		 {
			    int low = 0;
		        int high = length-1;
		        int ans=-1;

		        while (low <= high) {
		            int mid = (low + high) / 2;
		            if (key<=a[mid]) {
		                ans=mid;
		            	high = mid-1;
		            }
		            else{
		            		low=mid+1;
		            	}
		        }
		        return ans;
		}

		public long gcd(long r,long ans)
		{
			if(r==0) return ans;
			return gcd(ans%r,r);
		}
		public fast() {
			this(System.in);
		}
		public fast(InputStream is) {
			i = is;
		}
		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = i.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}
		public String nextString() {
     		int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
		public boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}
}

import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static final long mod = (long) (1e9 + 7);

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[][] = new long[n][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < n; i++) {
            dp[i][0] = (dp[i - 1][0] + dp[i - 1][1])%mod;
            dp[i][1] = dp[i - 1][0];
        }
        long ans = (dp[n - 1][0] + dp[n - 1][1] - 1)%mod;
        ans = ans * 2;
        ans = ans%mod;
        dp = new long[m][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < m; i++) {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][0];
        }
        long ans2 = (dp[m - 1][0] + dp[m - 1][1] - 1)%mod;
        ans2 = ans2 * 2;
        ans2 = ans2%mod;
        pw.println((ans + ans2 + 2)%mod);
        pw.close();
    }
}

import java.util.*;
import java.io.*;
public class Main {
    static class Scan {
        private byte[] buf=new byte[1024];
        private int index;
        private InputStream in;
        private int total;
        public Scan()
        {
            in=System.in;
        }
        public int scan()throws IOException
        {
            if(total<0)
            throw new InputMismatchException();
            if(index>=total)
            {
                index=0;
                total=in.read(buf);
                if(total<=0)
                return -1;
            }
            return buf[index++];
        }
        public int scanInt()throws IOException
        {
            int integer=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    integer*=10;
                    integer+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            return neg*integer;
        }
        public double scanDouble()throws IOException
        {
            double doub=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n)&&n!='.')
            {
                if(n>='0'&&n<='9')
                {
                    doub*=10;
                    doub+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            if(n=='.')
            {
                n=scan();
                double temp=1;
                while(!isWhiteSpace(n))
                {
                    if(n>='0'&&n<='9')
                    {
                        temp/=10;
                        doub+=(n-'0')*temp;
                        n=scan();
                    }
                    else throw new InputMismatchException();
                }
            }
            return doub*neg;
        }
        public String scanString()throws IOException
        {
            StringBuilder sb=new StringBuilder();
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            while(!isWhiteSpace(n))
            {
                sb.append((char)n);
                n=scan();
            }
            return sb.toString();
        }
        private boolean isWhiteSpace(int n)
        {
            if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
            return true;
            return false;
        }
    }

    public static void sort(int arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(int arr[],int l1,int r1,int l2,int r2) {
        int tmp[]=new int[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }

    public static void sort(long arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(long arr[],int l1,int r1,int l2,int r2) {
        long tmp[]=new long[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }
    static int lim;
    static long dp[][],mod;
    public static void main(String args[]) throws IOException {
        Scan input=new Scan();
        int n=input.scanInt();
        int m=input.scanInt();
        long ans=0;
        mod=1000000007;
        lim=n;
        init();
        ans+=solve(0,0);
        lim=m;
        init();
        ans+=solve(0,0);
        ans%=mod;
        System.out.println(ans);
    }
    public static long solve(int indx,int same) {
        if(indx==lim) {
            return 1;
        }
        if(dp[indx][same]!=-1) {
            return dp[indx][same];
        }
        long ans=0;
        if(same==0) {
            ans+=solve(indx+1,1);
            ans+=solve(indx+1,0);
        }
        if(same==1) {
            ans+=solve(indx+1,0);
        }
        ans%=mod;
        dp[indx][same]=ans;
        return ans;
    }
    public static void init() {
        dp=new long[100001][2];
        for(int i=0;i<dp.length;i++) {
            for(int j=0;j<dp[0].length;j++) {
                dp[i][j]=-1;
            }
        }
    }
}

import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

// 17:29.160, verdict?

public class cf1239a {

    public static void main(String[] args) throws IOException {
        prln(mmul(2, msub(madd(rni(), ni()), 1)));
        close();
    }

    static int mmod = 1000000007;

    static int madd(int a, int b) {
        return (a + b) % mmod;
    }

    static int madd(int... a) {
        int ans = a[0];
        for (int i = 1; i < a.length; ++i) {
            ans = madd(ans, a[i]);
        }
        return ans;
    }

    static int msub(int a, int b) {
        return (a - b + mmod) % mmod;
    }

    static int mmul(int a, int b) {
        return (int) ((long) a * b % mmod);
    }

    static int mmul(int... a) {
        int ans = a[0];
        for (int i = 1; i < a.length; ++i) {
            ans = mmul(ans, a[i]);
        }
        return ans;
    }

    static int minv(int x) {
        return mpow(x, mmod - 2);
    }

    static int mpow(int a, int b) {
        if (a == 0) {
            return 0;
        }
        int ans = 1;
        while (b > 0) {
            if ((b & 1) > 0) {
                ans = mmul(ans, a);
            }
            a = mmul(a, a);
            b >>= 1;
        }
        return ans;
    }

    static BufferedReader __in = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter __out = new PrintWriter(new OutputStreamWriter(System.out));
    static StringTokenizer input;
    static Random __rand = new Random();

    // references
    // IBIG = 1e9 + 7
    // IMAX ~= 2e9
    // LMAX ~= 9e18

    // constants
    static final int IBIG = 1000000007;
    static final int IMAX = 2147483647;
    static final int IMIN = -2147483648;
    static final long LMAX = 9223372036854775807L;
    static final long LMIN = -9223372036854775808L;
    // math util
    static int minof(int a, int b, int c) {return min(a, min(b, c));}
    static int minof(int... x) {if (x.length == 1) return x[0]; if (x.length == 2) return min(x[0], x[1]); if (x.length == 3) return min(x[0], min(x[1], x[2])); int min = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] < min) min = x[i]; return min;}
    static long minof(long a, long b, long c) {return min(a, min(b, c));}
    static long minof(long... x) {if (x.length == 1) return x[0]; if (x.length == 2) return min(x[0], x[1]); if (x.length == 3) return min(x[0], min(x[1], x[2])); long min = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] < min) min = x[i]; return min;}
    static int maxof(int a, int b, int c) {return max(a, max(b, c));}
    static int maxof(int... x) {if (x.length == 1) return x[0]; if (x.length == 2) return max(x[0], x[1]); if (x.length == 3) return max(x[0], max(x[1], x[2])); int max = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] > max) max = x[i]; return max;}
    static long maxof(long a, long b, long c) {return max(a, max(b, c));}
    static long maxof(long... x) {if (x.length == 1) return x[0]; if (x.length == 2) return max(x[0], x[1]); if (x.length == 3) return max(x[0], max(x[1], x[2])); long max = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] > max) max = x[i]; return max;}
    static int powi(int a, int b) {if (a == 0) return 0; int ans = 1; while (b > 0) {if ((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static long powl(long a, int b) {if (a == 0) return 0; long ans = 1; while (b > 0) {if ((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static int fli(double d) {return (int) d;}
    static int cei(double d) {return (int) ceil(d);}
    static long fll(double d) {return (long) d;}
    static long cel(double d) {return (long) ceil(d);}
    static int gcf(int a, int b) {return b == 0 ? a : gcf(b, a % b);}
    static long gcf(long a, long b) {return b == 0 ? a : gcf(b, a % b);}
    static int lcm(int a, int b) {return a * b / gcf(a, b);}
    static long lcm(long a, long b) {return a * b / gcf(a, b);}
    static int randInt(int min, int max) {return __rand.nextInt(max - min + 1) + min;}
    static long mix(long x) {x += 0x9e3779b97f4a7c15L; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9L; x = (x ^ (x >> 27)) * 0x94d049bb133111ebL; return x ^ (x >> 31);}
    // array util
    static void reverse(int[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {int swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(long[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {long swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(double[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {double swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(char[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {char swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void shuffle(int[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); int swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(long[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); long swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(double[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); double swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void rsort(int[] a) {shuffle(a); sort(a);}
    static void rsort(long[] a) {shuffle(a); sort(a);}
    static void rsort(double[] a) {shuffle(a); sort(a);}
    static int[] copy(int[] a) {int[] ans = new int[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static long[] copy(long[] a) {long[] ans = new long[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static double[] copy(double[] a) {double[] ans = new double[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static char[] copy(char[] a) {char[] ans = new char[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    // graph util
    static List<List<Integer>> g(int n) {List<List<Integer>> g = new ArrayList<>(); for (int i = 0; i < n; ++i) g.add(new ArrayList<>()); return g;}
    static List<Set<Integer>> sg(int n) {List<Set<Integer>> g = new ArrayList<>(); for (int i = 0; i < n; ++i) g.add(new HashSet<>()); return g;}
    static void c(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v); g.get(v).add(u);}
    static void cto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v);}
    static void dc(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v); g.get(v).remove(u);}
    static void dcto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v);}
    // input
    static void r() throws IOException {input = new StringTokenizer(rline());}
    static int ri() throws IOException {return Integer.parseInt(rline());}
    static long rl() throws IOException {return Long.parseLong(rline());}
    static double rd() throws IOException {return Double.parseDouble(rline());}
    static int[] ria(int n) throws IOException {int[] a = new int[n]; r(); for (int i = 0; i < n; ++i) a[i] = ni(); return a;}
    static int[] riam1(int n) throws IOException {int[] a = new int[n]; r(); for (int i = 0; i < n; ++i) a[i] = ni() - 1; return a;}
    static long[] rla(int n) throws IOException {long[] a = new long[n]; r(); for (int i = 0; i < n; ++i) a[i] = nl(); return a;}
    static double[] rda(int n) throws IOException {double[] a = new double[n]; r(); for (int i = 0; i < n; ++i) a[i] = nd(); return a;}
    static char[] rcha() throws IOException {return rline().toCharArray();}
    static String rline() throws IOException {return __in.readLine();}
    static String n() {return input.nextToken();}
    static int rni() throws IOException {r(); return ni();}
    static int ni() {return Integer.parseInt(n());}
    static long rnl() throws IOException {r(); return nl();}
    static long nl() {return Long.parseLong(n());}
    static double rnd() throws IOException {r(); return nd();}
    static double nd() {return Double.parseDouble(n());}
    static List<List<Integer>> rg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rg(List<List<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<List<Integer>> rdg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdg(List<List<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rsg(List<Set<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rdsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdsg(List<Set<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    // output
    static void pr(int i) {__out.print(i);}
    static void prln(int i) {__out.println(i);}
    static void pr(long l) {__out.print(l);}
    static void prln(long l) {__out.println(l);}
    static void pr(double d) {__out.print(d);}
    static void prln(double d) {__out.println(d);}
    static void pr(char c) {__out.print(c);}
    static void prln(char c) {__out.println(c);}
    static void pr(char[] s) {__out.print(new String(s));}
    static void prln(char[] s) {__out.println(new String(s));}
    static void pr(String s) {__out.print(s);}
    static void prln(String s) {__out.println(s);}
    static void pr(Object o) {__out.print(o);}
    static void prln(Object o) {__out.println(o);}
    static void prln() {__out.println();}
    static void pryes() {prln("yes");}
    static void pry() {prln("Yes");}
    static void prY() {prln("YES");}
    static void prno() {prln("no");}
    static void prn() {prln("No");}
    static void prN() {prln("NO");}
    static void pryesno(boolean b) {prln(b ? "yes" : "no");};
    static void pryn(boolean b) {prln(b ? "Yes" : "No");}
    static void prYN(boolean b) {prln(b ? "YES" : "NO");}
    static void prln(int... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static void prln(long... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static void prln(double... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static <T> void prln(Collection<T> c) {int n = c.size() - 1; Iterator<T> iter = c.iterator(); for (int i = 0; i < n; pr(iter.next()), pr(' '), ++i); if (n >= 0) prln(iter.next()); else prln();}
    static void h() {prln("hlfd"); flush();}
    static void flush() {__out.flush();}
    static void close() {__out.close();}}

import java.io.*;
import java.util.*;

public class IvanFool {

	static FastReader sc=new FastReader();

	public static final long MOD=1000000007;

	void run() {
	    int n=sc.nextInt();
	    int m=sc.nextInt();

	    long fib[]=new long[100003];
	    fib[1]=1;
	    fib[2]=2;
	    for(int i=3;i<=m;i++){
	        fib[i]=(fib[i-1]+fib[i-2])%MOD;
	    }
	    long res=(((fib[n]+fib[m])%MOD)-1+MOD)%MOD;
	    res=(2*res)%MOD;
	    System.out.println(res);
	}

	public static void main(String args[]) throws IOException {
		new IvanFool().run();
	}

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Round594C {

	public static int mod = (int)1e9+7;

	public static void solve() {
		long n=s.nextInt();
		long m=s.nextInt();
		long ans= 2*m + 2*n - 2;
		ans%=mod;
		out.println(ans);
	}

	public static void main(String[] args) {
		out = new PrintWriter(new BufferedOutputStream(System.out));
		s = new FastReader();
		solve();
		out.close();
	}

	public static FastReader s;
	public static PrintWriter out;

	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception e) {
				e.printStackTrace();
			}
			return str;
		}
	}

}

import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(System.out);

        String str[]=br.readLine().split(" ");
        int n=Integer.parseInt(str[0]);
        int m=Integer.parseInt(str[1]);
        pw.println(2*(n+m-1)%1000000007);
        pw.flush();
        pw.close();
    }
}

import java.io.*;
import java.util.*;

public class Main
{
    static final int MOD=  (int)1e9 + 7 ;

    static int [][] mat ;
    static int [] dx = {-1 , 1 , 0 , 0} , dy = {0 , 0 , -1 , 1} ;
    static boolean isValid(int x , int y)
    {
        return x >= 0 && y >=0 && x < mat.length && y < mat[0].length ;
    }
    static int bt(int idx , int n , int m)
    {
        if(idx == n * m )
        {
            boolean can = true ;
            for(int i  = 0; i < mat.length ; i++)
                for(int j = 0 ; j < mat[0].length ; j ++) {
                    int cnt =0 ;
                    for (int k = 0; k < 4; k++)
                        if (isValid(i + dx[k], j + dy[k]))
                            cnt += mat[i][j] == mat[i + dx[k]][j + dy[k]] ? 1 : 0;
                    can &= cnt <= 1 ;
                }
            return can ? 1 : 0 ;
        }
        int ans =0 ;
        mat[idx / m][idx % m] = 0 ;
        ans += bt(idx+  1 , n, m) ;
        mat[idx / m][idx % m] = 1 ;
        ans += bt(idx + 1 , n , m) ;
        return ans ;
    }
    static int solve(int n , int m)
    {
        mat = new int [n][m] ;
        return bt(0 , n , m) ;
    }
    static int memo[][][]; // idx , last,cur
    static int n ;
    static int dp(int idx , int last , int cur)
    {
        if(idx == n - 1) return 1 ;
        if(memo[idx][last][cur] != -1)
            return memo[idx][last][cur] ;
        int ans = 0 ;
        for(int nxt = 1 ; nxt <= 2 ; nxt++) {
            int same = 0 ;
            if (last == cur) same ++ ;
            if(cur == nxt && idx < n - 1) same ++ ;
            if(same <= 1)
                ans += dp(idx + 1 , cur , nxt) ;
            ans %= MOD ;
        }
        return memo[idx][last][cur] = ans ;
    }

    // 0 ,2, 4,8,14,24 , 40,66
    public static void main(String[] args) throws Exception
    {
        Scanner sc = new Scanner(System.in) ;
        PrintWriter out = new PrintWriter(System.out) ;
//        for(int i = 1 ; i <= 6 ; i++)
//            System.out.println(3+" "+i+" "+solve(3 , i));
        n = sc.nextInt() ;
        int m = sc.nextInt() ;
        int [] fib = new int [m + 1] ;
        memo = new int [n][3][3] ;
        for(int i  = 0 ;i < n ; i ++)
            for(int j = 0 ; j < 3 ; j++)
                Arrays.fill(memo[i][j] , -1);
        fib[1] = (dp(0 , 0 , 1) + dp(0 , 0 , 2)) % MOD ;
        if(m == 1)
        {
            System.out.println(fib[1]);
            return;
        }
        else if(m == 2)
        {
            System.out.println((fib[1] + 2) % MOD);
            return;

        }
        fib[2] = fib[1] + 2;
        fib[3] = fib[2] + 2 ;
        int diff = (fib[1] + fib[2] - fib[3] + MOD) % MOD;
        for(int i = 4 ; i <= m ; i ++)
            fib[i] = (fib[i - 1] + fib[i - 2] - diff + MOD) % MOD ;
        out.println(fib[m]);
        out.flush();
    }

    static class Scanner
    {
        BufferedReader br ;
        StringTokenizer st ;

        Scanner(String path) throws Exception
        {
            br = new BufferedReader(new FileReader(path)) ;
        }
        Scanner (InputStream in) throws Exception
        {
            br = new BufferedReader(new InputStreamReader(in)) ;
        }
        String next() throws Exception
        {
            while (st == null || !st.hasMoreElements())
                st = new StringTokenizer(br.readLine()) ;
            return st.nextToken() ;
        }
        int nextInt() throws Exception
        {
            return Integer.parseInt(next()) ;
        }
        long nextLong() throws Exception
        {
            return Long.parseLong(next()) ;
        }
    }
}

import java.io.PrintWriter;
import java.util.*;

public class Main {
    private static int mod = 1_000_000_007;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
       int n, m;
       n = in.nextInt();
       m = in.nextInt();
       int[] f = new int[Math.max(n, m) + 1];
       f[0] = 1;
       f[1] = 1;
       for (int i = 2; i < f.length; i++) {
           f[i] = f[i - 1] + f[i - 2];
           f[i] %= mod;
       }
       out.println((2 * (f[n] + f[m] - 1) % mod) % mod);
       out.close();
    }
}

import java.util.Scanner;

public class Main {
	public static int maxn=100010,n,m;
	public static long ans=0;
    public static long fib(int n) {
        if(n < 2)
            return n;
        int f = 0, g = 1;
        int result = 0;
        for(int i = 1; i < n; i++){
            result = f + g;
            f = g;
            g = result;
        }
        return result;
    }
		public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		n=sc.nextInt()+1;
		m=sc.nextInt()+1;
		System.out.println(((fib(n)+fib(m)-1)*2)%1000000007);
	}
}

import java.util.Scanner;

public class SolutionC {
  static Scanner scanner = new Scanner(System.in);

  public static void main(String[] args) {
    int N = scanner.nextInt();
    int M = scanner.nextInt();
    if (N <= 0 || M <= 0) {
      System.out.println("0");
      return;
    }

    final long MODULO = 1000000007;

    int L = Math.max(M, N);
    int offset = 2;
    long[] vals = new long[L + offset];
    vals[0] = 0;
    vals[1] = 2;
    for (int i = 0; i < L; i++) {
      vals[offset + i] = (vals[offset + i - 1] + vals[offset + i - 2]) % MODULO;
    }
    System.out.println(vals[N - 1 + offset] + vals[M - 1 + offset] - 2);
  }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class Pair<A, B> {
	A first;
	B second;

	Pair(A first, B second) {
		this.first = first;
		this.second = second;
	}

}

class TaskB {
	long INF = (long) 1e18 + 5;
	long mod = (long) 1e9 + 7;

	public void solve(int testNumber, InputReader in, PrintWriter pw) {
		int N = in.nextInt();
		int M = in.nextInt();
		long ans = 2 * (fib(N) + fib(M) - 1);
		pw.println(ans);
//
//		for (int i = 0; i < N; i++) {
//			pw.println(Arrays.toString(dp[i]));
//		}
	}

	long fib(int N) {
		long fib[] = new long[N + 1];
		fib[0] = 1;
		fib[1] = 1;
		for (int i = 2; i <= N; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
		}
		return fib[N];
	}

	long sum(int i, int j, long arr[]) {
		long sum = 0;
		for (int k = i; k <= j; k++) {
			sum += arr[k];
		}
		return sum;
	}

	boolean FirstRow_Col(Pair<Integer, Integer> pair) {
		return pair.first == 0 || pair.second == 0;
	}

	int __gcd(int a, int b) {
		if (b == 0)
			return a;
		return __gcd(b, a % b);

	}

	public int getInt(int num) {
		int ret = -1;
		switch (num) {
		case 0:
			ret = 6;
			break;
		case 1:
			ret = 2;
			break;
		case 2:
			ret = 5;
			break;
		case 3:
			ret = 5;
			break;
		case 4:
			ret = 4;
			break;
		case 5:
			ret = 5;
			break;
		case 6:
			ret = 6;
			break;
		case 7:
			ret = 3;
			break;
		case 8:
			ret = 7;
			break;
		case 9:
			ret = 6;
			break;
		}
		return ret;
	}

	public int isPow(long num) {
		int count = 0;
		while (num > 0) {
			num /= 2;
			count++;
		}
		return count;
	}
}

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class contest {
	static long A = 1000000000+7;
	static long[] fib = new long[100002];
	public static long fib(int n) {
		if(n<0)return 0;
		if(fib[n]!=0)return fib[n];
		fib[0]=1;
		fib[1]=2;
		fib[2]=2;
		for(int i=3;i<=n;i++) {
			fib[i]=(2*(fib[i-2]%A+fib[i-3]%A)%A)%A;
		}
		return fib[n];
	}
	public static long f(int n ,int m) {
		if(n==1) {
			return fib(n)+fib(m);
		}else if(m==1)
			return fib(n)+fib(m);
		long r;
		 r = 2*(fib(n-2)%A+fib(n-3)%A)%A;
		r%=A;
		long r2 = 2*(fib(m-2)%A+fib(m-3)%A)%A;
		r2%=A;
		r = (r+r2)%A;
		return r;
	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		System.out.println(f(sc.nextInt(),sc.nextInt()));
		pw.flush();
		pw.close();
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * Created by Katushka on 20.10.2019.
 */
public class IvanTheFoolProbability {

    final static long MOD = 1000000007;

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n1 = in.nextInt();
        int m1 = in.nextInt();

        int n = Math.min(n1, m1);
        int m = Math.max(n1, m1);

        if (n == 1 && m == 1) {
            System.out.println(2);
            return;
        }

        long firstRowDP[][] = new long[m][4];
        firstRowDP[1][0] = 1;
        firstRowDP[1][1] = 1;
        firstRowDP[1][2] = 1;
        firstRowDP[1][3] = 1;

        for (int i = 2; i < m; i++) {
            firstRowDP[i][0] = firstRowDP[i - 1][2];
            firstRowDP[i][1] = (firstRowDP[i-1][0] + firstRowDP[i - 1][2]) % MOD;
            firstRowDP[i][2] = (firstRowDP[i-1][1] + firstRowDP[i - 1][3]) % MOD;
            firstRowDP[i][3] = firstRowDP[i - 1][1];
        }

        System.out.println(firstRowDP[m-1][0] + firstRowDP[m-1][1] + firstRowDP[m-1][2] + firstRowDP[m-1][3] + (n > 1 ? 2 : 0));

    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    final String str = reader.readLine();
                    tokenizer = new StringTokenizer(str);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }
    }
}

//package CodeforcesProject;

import java.io.*;
import java.lang.*;
import java.util.*;

public class Main extends IO {

    public static void main(String[] args) throws Exception {
        int[] quantity = readArrayInt(" ");
        int[] base = new int[Math.max(quantity[0], quantity[1]) + 1];
        base[0] = 1;
        base[1] = 1;
        for (int i = 2; i < base.length; i++){
            base[i] = base[i - 2] + base[i - 1];
        }
        System.out.print(2 * (base[quantity[0]] + base[quantity[1]] - 1));
    }

}

class math {

    protected static int gcd(int a, int b) { // NOD
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static float gcd(float a, float b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static double gcd(double a, double b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static double lcm(double a, double b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static float lcm(float a, float b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static int lcm(int a, int b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static long lcm(long a, long b) {
        return a / gcd(a, b) * b;

    }
}

class Division<T extends Number> extends Pair {

    private Division(T dividend, T divider) {
        super(dividend, divider);
        reduce();
    }

    protected static <T extends Number> Division<T> createDivision(T dividend, T divider) {
        return new Division<>(dividend, divider);
    }

    protected void reduce() {
        if (getFirstElement() instanceof Integer) {
            Integer Dividend = (Integer) getFirstElement();
            Integer Divider = (Integer) getSecondElement();
            int gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Long) {
            Long Dividend = (Long) getFirstElement();
            Long Divider = (Long) getSecondElement();
            long gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Float) {
            Float Dividend = (Float) getFirstElement();
            Float Divider = (Float) getSecondElement();
            float gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Double) {
            Double Dividend = (Double) getFirstElement();
            Double Divider = (Double) getSecondElement();
            double gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        }
    }

    protected void addWithoutReturn(Division number) throws UnsupportedOperationException {
        add(number, 0);
    }

    private Division add(Division number, int function) throws UnsupportedOperationException {
        if (getFirstElement() instanceof Integer && number.getFirstElement() instanceof Integer) {
            Integer Dividend = (Integer) getFirstElement();
            Integer Divider = (Integer) getSecondElement();
            Integer Dividend1 = (Integer) number.getFirstElement();
            Integer Divider1 = (Integer) number.getSecondElement();
            Integer lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;

        } else if (getFirstElement() instanceof Long && number.getFirstElement() instanceof Long) {
            Long Dividend = (Long) getFirstElement();
            Long Divider = (Long) getSecondElement();
            Long Dividend1 = (Long) number.getFirstElement();
            Long Divider1 = (Long) number.getSecondElement();
            Long lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else if (getFirstElement() instanceof Float && number.getFirstElement() instanceof Float) {
            Float Dividend = (Float) getFirstElement();
            Float Divider = (Float) getSecondElement();
            Float Dividend1 = (Float) number.getFirstElement();
            Float Divider1 = (Float) number.getSecondElement();
            Float lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else if (getFirstElement() instanceof Double && number.getFirstElement() instanceof Double) {
            Double Dividend = (Double) getFirstElement();
            Double Divider = (Double) getSecondElement();
            Double Dividend1 = (Double) number.getFirstElement();
            Double Divider1 = (Double) number.getSecondElement();
            Double lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else {
            throw new UnsupportedOperationException();
        }
    }

    protected Division addWithReturn(Division number) {
        return add(number, 1);
    }

    protected void multiplyWithoutReturn(Division number) throws UnsupportedOperationException {
        multiply(number, 0);
    }

    protected Division multiplyWithReturn(Division number) throws UnsupportedOperationException {
        return multiply(number, 1);
    }

    private Division multiply(Division number, int function) throws UnsupportedOperationException {
        if (getFirstElement() instanceof Integer && number.getFirstElement() instanceof Integer) {
            Integer first = (Integer) getFirstElement() * (Integer) number.getFirstElement();
            Integer second = (Integer) getSecondElement() * (Integer) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else if (getFirstElement() instanceof Long && number.getFirstElement() instanceof Long) {
            Long first = (Long) getFirstElement() * (Long) number.getFirstElement();
            Long second = (Long) getSecondElement() * (Long) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;

        } else if (getFirstElement() instanceof Float && number.getFirstElement() instanceof Float) {
            Float first = (Float) getFirstElement() * (Float) number.getFirstElement();
            Float second = (Float) getSecondElement() * (Float) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else if (getFirstElement() instanceof Double && number.getFirstElement() instanceof Double) {
            Double first = (Double) getFirstElement() * (Double) number.getFirstElement();
            Double second = (Double) getSecondElement() * (Double) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else {
            throw new UnsupportedOperationException();
        }
    }
}

class Pair<T, T1> {

    private T first;
    private T1 second;

    Pair(T obj, T1 obj1) {
        first = obj;
        second = obj1;
    }

    protected static <T, T1> Pair<T, T1> createPair(T element, T1 element1) {
        return new Pair<>(element, element1);
    }

    protected T getFirstElement() {
        return first;
    }

    protected T1 getSecondElement() {
        return second;
    }

    protected void setFirst(T element) {
        first = element;
    }

    protected void setSecond(T1 element) {
        second = element;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Pair)) {
            return false;
        }
        Pair pair = (Pair) obj;
        return first == pair.first && second == pair.second;
    }

    @Override
    public int hashCode() {
        return 1;
    }
}

class Graph {

    private int[][] base;
    private boolean[] used;
    private int quantity;
    private Integer[] ancestor;

    public int[][] getBase() {
        return base.clone();
    }

    public boolean[] getUsed() {
        return used.clone();
    }

    public int getQuantity() {
        return quantity;
    }

    public Integer[] getAncestor() {
        return ancestor.clone();
    }

    public void start(int length) {
        used = new boolean[length];
        ancestor = new Integer[length];
        ancestor[0] = -1;
        quantity = 0;
    }

    public void ribMatrixToDefault(int length, int quantity, boolean readConsole, int[][] value) throws Exception {
        base = new int[length][];
        List<ArrayList<Integer>> inputBase = new ArrayList<>();
        for (int i = 0; i < length; i++) {
            inputBase.add(new ArrayList<>());
        }
        for (int i = 0; i < quantity; i++) {
            int[] input = readConsole ? IO.readArrayInt(" ") : value[i];
            inputBase.get(input[0] - 1).add(input[1] - 1);
            //inputBase.get(input[0] - 1).add(input[2]); // price
            inputBase.get(input[1] - 1).add(input[0] - 1);
            //inputBase.get(input[1] - 1).add(input[2]); // price
        }
        for (int i = 0; i < length; i++) {
            base[i] = inputBase.get(i).stream().mapToInt(Integer::intValue).toArray();
        }
        start(length);
    }

    public void adjacencyMatrixToDefault(int length, int not, boolean readConsole, int[][] value) throws Exception {
        base = new int[length][];
        List<Integer> buffer = new ArrayList<>();
        int[] InputArray;
        for (int i = 0; i < length; i++) {
            InputArray = readConsole ? IO.readArrayInt(" ") : value[i];
            for (int index = 0; index < length; index++) {
                if (i != index && InputArray[index] != not) {
                    buffer.add(index);
                    // buffer.add(InputArray[index]); // price
                }
            }
            base[i] = buffer.stream().mapToInt(Integer::intValue).toArray();
            buffer.clear();
        }
        start(length);
    }

    public void dfs(int position) throws Exception {
        used[position] = true;
        quantity++;
        int next;
        for (int index = 0; index < base[position].length; index += 2) {
            next = base[position][index];
            if (!used[next]) {
                ancestor[next] = position;
                dfs(next);
            } else {
                if (next != ancestor[position]) { // if cycle
                    throw new Exception();
                }
            }
        }
    }

    public int dijkstra(int start, int stop, int size) {
        start--;
        stop--;
        int[] dist = new int[size];
        for (int i = 0; i < size; i++) {
            if (i != start) {
                dist[i] = Integer.MAX_VALUE;
            }
            ancestor[i] = start;
        }

        Queue<int[]> queue = new PriorityQueue<>(Comparator.comparingInt((int[] ints) -> ints[1]));
        queue.add(new int[]{start, 0});
        int position;
        int[] getQueue;
        while (queue.size() != 0) {
            getQueue = queue.poll();
            position = getQueue[0];
            if (getQueue[1] > dist[position]) {
                continue;
            }
            for (int index = 0; index < base[position].length; index += 2) {
                if (dist[position] + base[position][index + 1] < dist[base[position][index]] && !used[base[position][index]]) {
                    dist[base[position][index]] = dist[position] + base[position][index + 1];
                    ancestor[base[position][index]] = position;
                    queue.add(new int[]{base[position][index], dist[base[position][index]]});
                }
            }
            used[position] = true;
        }
        return dist[stop] == Integer.MAX_VALUE ? -1 : dist[stop];
    }

    public static boolean floydWarshall(int[][] base, int length, int not) {
        for (int k = 0; k < length; k++) {
            for (int i = 0; i < length; i++) {
                for (int j = 0; j < length; j++) {
                    if (base[i][k] == not || base[k][j] == not) {
                        continue;
                    }
                    int total = base[i][k] + base[k][j];
                    if (base[i][j] != not) {
                        base[i][j] = Math.min(base[i][j], total);
                    } else {
                        base[i][j] = total;
                    }
                }
            }
        }
        for (int index = 0; index < length; index++) {
            if (base[index][index] != 0) { // if cycle
                return false;
            }
        }
        return true;
    }
}

interface Array {
    void useArray(int[] a);
}

interface Method {
    void use();
}

class FastSort {

    protected static void sortWithoutReturn(int[] array, int length, int ShellHeapMergeMyInsertionSort) {
        sort(array, ShellHeapMergeMyInsertionSort, length);
    }

    protected static int[] sortWithReturn(int[] array, int length, int ShellHeapMergeMyInsertionSort) {
        int[] base = array.clone();
        sort(base, ShellHeapMergeMyInsertionSort, length);
        return base;
    }

    private static void sort(int[] array, int ShellHeapMergeMyInsertionSort, int length) {
        if (ShellHeapMergeMyInsertionSort < 0 || ShellHeapMergeMyInsertionSort > 4) {
            Random random = new Random();
            ShellHeapMergeMyInsertionSort = random.nextInt(4);
        }
        if (ShellHeapMergeMyInsertionSort == 0) {
            ShellSort(array);
        } else if (ShellHeapMergeMyInsertionSort == 1) {
            HeapSort(array);
        } else if (ShellHeapMergeMyInsertionSort == 2) {
            MergeSort(array, 0, length - 1);
        } else if (ShellHeapMergeMyInsertionSort == 3) {
            straightMergeSort(array, length);
        } else if (ShellHeapMergeMyInsertionSort == 4) {
            insertionSort(array);
        }
    }

    private static void straightMergeSort(int[] array, int size) {
        if (size == 0) {
            return;
        }
        int length = (size / 2) + ((size % 2) == 0 ? 0 : 1);
        Integer[][] ZeroBuffer = new Integer[length + length % 2][2];
        Integer[][] FirstBuffer = new Integer[0][0];
        for (int index = 0; index < length; index++) {
            int ArrayIndex = index * 2;
            int NextArrayIndex = index * 2 + 1;
            if (NextArrayIndex < size) {
                if (array[ArrayIndex] > array[NextArrayIndex]) {
                    ZeroBuffer[index][0] = array[NextArrayIndex];
                    ZeroBuffer[index][1] = array[ArrayIndex];
                } else {
                    ZeroBuffer[index][0] = array[ArrayIndex];
                    ZeroBuffer[index][1] = array[NextArrayIndex];
                }
            } else {
                ZeroBuffer[index][0] = array[ArrayIndex];
            }
        }
        boolean position = false;
        int pointer0, pointer, pointer1, number = 4, NewPointer, count;
        Integer[][] NewBuffer;
        Integer[][] OldBuffer;
        length = (size / 4) + ((size % 4) == 0 ? 0 : 1);
        while (true) {
            pointer0 = 0;
            count = (number / 2) - 1;
            if (!position) {
                FirstBuffer = new Integer[length + length % 2][number];
                NewBuffer = FirstBuffer;
                OldBuffer = ZeroBuffer;
            } else {
                ZeroBuffer = new Integer[length + length % 2][number];
                NewBuffer = ZeroBuffer;
                OldBuffer = FirstBuffer;
            }
            for (int i = 0; i < length; i++) {
                pointer = 0;
                pointer1 = 0;
                NewPointer = pointer0 + 1;
                if (length == 1) {
                    for (int g = 0; g < size; g++) {
                        if (pointer > count || OldBuffer[pointer0][pointer] == null) {
                            array[g] = OldBuffer[NewPointer][pointer1];
                            pointer1++;
                        } else if (pointer1 > count || OldBuffer[NewPointer][pointer1] == null) {
                            if (OldBuffer[pointer0][pointer] == null) {
                                continue;
                            }
                            array[g] = OldBuffer[pointer0][pointer];
                            pointer++;
                        } else if (OldBuffer[pointer0][pointer] >= OldBuffer[NewPointer][pointer1]) {
                            array[g] = OldBuffer[NewPointer][pointer1];
                            pointer1++;
                        } else {
                            array[g] = OldBuffer[pointer0][pointer];
                            pointer++;
                        }
                    }
                    return;
                }
                for (int g = 0; g < number; g++) {
                    if (pointer > count || OldBuffer[pointer0][pointer] == null) {
                        if (OldBuffer[NewPointer][pointer1] == null) {
                            continue;
                        }
                        NewBuffer[i][g] = OldBuffer[NewPointer][pointer1];
                        pointer1++;
                    } else if (pointer1 > count || OldBuffer[NewPointer][pointer1] == null) {
                        if (OldBuffer[pointer0][pointer] == null) {
                            continue;
                        }
                        NewBuffer[i][g] = OldBuffer[pointer0][pointer];
                        pointer++;
                    } else if (OldBuffer[pointer0][pointer] >= OldBuffer[NewPointer][pointer1]) {
                        NewBuffer[i][g] = OldBuffer[NewPointer][pointer1];
                        pointer1++;
                    } else {
                        NewBuffer[i][g] = OldBuffer[pointer0][pointer];
                        pointer++;
                    }
                }
                pointer0 += 2;
            }
            position = !position;
            length = length / 2 + length % 2;
            number *= 2;
        }
    }

    private static void ShellSort(int[] array) {
        int j;
        for (int gap = array.length / 2; gap > 0; gap /= 2) {
            for (int i = gap; i < array.length; i++) {
                int temp = array[i];
                for (j = i; j >= gap && array[j - gap] > temp; j -= gap) {
                    array[j] = array[j - gap];
                }
                array[j] = temp;
            }
        }
    }

    private static void HeapSort(int[] array) {
        for (int i = array.length / 2 - 1; i >= 0; i--)
            shiftDown(array, i, array.length);
        for (int i = array.length - 1; i > 0; i--) {
            swap(array, 0, i);
            shiftDown(array, 0, i);
        }
    }

    private static void shiftDown(int[] array, int i, int n) {
        int child;
        int tmp;
        for (tmp = array[i]; leftChild(i) < n; i = child) {
            child = leftChild(i);
            if (child != n - 1 && (array[child] < array[child + 1]))
                child++;
            if (tmp < array[child])
                array[i] = array[child];
            else
                break;
        }
        array[i] = tmp;
    }

    private static int leftChild(int i) {
        return 2 * i + 1;
    }

    private static void swap(int[] array, int i, int j) {
        int temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }

    private static void MergeSort(int[] array, int low, int high) {
        if (low < high) {
            int mid = (low + high) / 2;
            MergeSort(array, low, mid);
            MergeSort(array, mid + 1, high);
            merge(array, low, mid, high);
        }
    }

    private static void merge(int[] array, int low, int mid, int high) {
        int n = high - low + 1;
        int[] Temp = new int[n];
        int i = low, j = mid + 1;
        int k = 0;
        while (i <= mid || j <= high) {
            if (i > mid)
                Temp[k++] = array[j++];
            else if (j > high)
                Temp[k++] = array[i++];
            else if (array[i] < array[j])
                Temp[k++] = array[i++];
            else
                Temp[k++] = array[j++];
        }
        for (j = 0; j < n; j++)
            array[low + j] = Temp[j];
    }

    private static void insertionSort(int[] elements) {
        for (int i = 1; i < elements.length; i++) {
            int key = elements[i];
            int j = i - 1;
            while (j >= 0 && key < elements[j]) {
                elements[j + 1] = elements[j];
                j--;
            }
            elements[j + 1] = key;
        }
    }
}

class IO {

    private static BufferedReader read;
    private static boolean fileInput = false;
    private static BufferedWriter write;
    private static boolean fileOutput = false;

    public static void setFileInput(boolean fileInput) {
        IO.fileInput = fileInput;
    }

    public static void setFileOutput(boolean fileOutput) {
        IO.fileOutput = fileOutput;
    }

    private static void startInput() {
        try {
            read = new BufferedReader(fileInput ? new FileReader("input.txt") : new InputStreamReader(System.in));
        } catch (Exception error) {
        }
    }

    private static void startOutput() {
        try {
            write = new BufferedWriter(fileOutput ? new FileWriter("output.txt") : new OutputStreamWriter(System.out));
        } catch (Exception error) {
        }
    }

    protected static int readInt() throws Exception {
        if (read == null) {
            startInput();
        }
        return Integer.parseInt(read.readLine());
    }

    protected static long readLong() throws Exception {
        if (read == null) {
            startInput();
        }
        return Long.parseLong(read.readLine());
    }

    protected static String readString() throws Exception {
        if (read == null) {
            startInput();
        }
        return read.readLine();
    }

    protected static int[] readArrayInt(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return Arrays.stream(read.readLine().split(split)).mapToInt(Integer::parseInt).toArray();
    }

    protected static long[] readArrayLong(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return Arrays.stream(read.readLine().split(split)).mapToLong(Long::parseLong).toArray();
    }

    protected static String[] readArrayString(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return read.readLine().split(split);
    }

    protected static void writeArray(int[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Integer.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(Integer[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Integer.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(long[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Long.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(Long[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Long.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    public static void writeArray(String[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(array[index]);
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception ignored) {
        }
    }

    protected static void writeArray(boolean[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Boolean.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception ignored) {
        }
    }

    protected static void writeInt(int number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Integer.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeInt(Integer number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Integer.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeLong(long number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Long.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeLong(Long number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Long.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeString(String word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeBoolean(boolean value, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(value ? "true" : "false");
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeBoolean(Boolean value, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(value ? "true" : "false");
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeChar(char word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeChar(Character word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeEnter() {
        if (write == null) {
            startOutput();
        }
        try {
            write.newLine();
        } catch (Exception ignored) {
        }
    }

    protected static void print(boolean exit) throws Exception {
        if (exit) {
            print();
        } else {
            write.flush();
        }
    }

    protected static void print() throws Exception {
        if (write == null) {
            return;
        }
        write.flush();
        read.close();
        write.close();
    }
}

import java.io.*;
import java.util.*;

public class c{

    public static void main(String[] args) {
      MyScanner sc = new MyScanner();
      out = new PrintWriter(new BufferedOutputStream(System.out));

      int MODULO = 1000000007;

      int m = sc.nextInt();
      int n = sc.nextInt();
      m = Math.min(m,n);
      n = Math.max(m,n);

      int a = 0;
      int b = 2;
      int c = 2;
      int temp = 0;
      int temp2 = 0;
      int counter = 1;

      int m2 = 0;
      int n2 = 0;
      while(n2==0) {
          if(counter == m) {
              m2 = c;
          }
          if(counter == n) {
              n2 = c;
          }
        //   System.out.println(counter+""+a+""+b+""+c);
          temp = b;
          temp2 = c;
          a = b;
          b = c;
          c = (temp + temp2)%MODULO;
          counter += 1;

      }
    out.println((m2+n2-2)%MODULO);

      // Start writing your solution here. -------------------------------------

      /*
      int n      = sc.nextInt();        // read input as integer
      long k     = sc.nextLong();       // read input as long
      double d   = sc.nextDouble();     // read input as double
      String str = sc.next();           // read input as String
      String s   = sc.nextLine();       // read whole line as String

      int result = 3*n;
      out.println(result);                    // print via PrintWriter
      */

      // Stop writing your solution here. -------------------------------------
      out.close();
   }

   public static int match(char[] a, char[] b) {
      int count = 0;
      for(int i =0; i<a.length; i++) {
          if(a[i]==b[i]) {
              count++;
          }
      }
      return a.length-count;
   }

   static  class pair{
    int u;
    int v;
    int w;
    int x;
    pair(int u, int v, int w, int x) {
        this.u=u;
        this.v=v;
        this.w=w;
        this.x=x;
    }

}

static class sortbyarr implements Comparator<pair>
{
    // Used for sorting in ascending order of
    // roll number
    public int compare(pair a, pair b)
    {
        return a.u - b.u;
    }
}

static class sortbyi implements Comparator<pair>
{
    // Used for sorting in ascending order of
    // roll number
    public int compare(pair a, pair b)
    {
        return a.x - b.x;
    }
}

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;

   //-----------MyScanner class for faster input----------
   public static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int nextInt() {
          return Integer.parseInt(next());
      }

      long nextLong() {
          return Long.parseLong(next());
      }

      double nextDouble() {
          return Double.parseDouble(next());
      }

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }

   }
   //--------------------------------------------------------
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
//import java.math.*;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */

public class Main {

	static int MD= 1000000007;
    public static void main(String[] args) throws IOException {
    	OutputStream outputStream = System.out;
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {

        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
        	int t=1;
        	while(t-->0) {
        		long n=in.nextLong();
        		long m=in.nextLong();
        		long ans=fexp(2,(n+1)/2,MD);
        		ans=fexp(ans,m,MD);
        		out.println(ans);

        	}

        }

    }

    static class InputReader
    {
        BufferedReader br;
        StringTokenizer st;

        public InputReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }

    }
    static void sort(int[] a, int low, int high)
    {
        int N = high - low;
        if (N <= 1)
            return;
        int mid = low + N/2;
        sort(a, low, mid);
        sort(a, mid, high);
        int[] temp = new int[N];
        int i = low, j = mid;
        for (int k = 0; k < N; k++)
        {
            if (i == mid)
                temp[k] = a[j++];
            else if (j == high)
                temp[k] = a[i++];
            else if (a[j]<a[i])
                temp[k] = a[j++];
            else
                temp[k] = a[i++];
        }
        for (int k = 0; k < N; k++)
            a[low + k] = temp[k];
    }
    public static long fexp(long x, long y, long p) {
        long res = 1;

        x = x % p;

        while (y > 0)
        {

            if((y & 1)==1)
                res = (res * x) % p;

            y = y >> 1;
            x = (x * x) % p;
        }
        return res;

    }
    static int gcd(int a, int b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);

    }

}

import java.util.*;

public class IvanTheFool {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();

		long ans = 1;

		if (n == 1 || m == 1) {
			if (n == 1) {
				ans = m * 2;
			} else {
				ans = n * 2;
			}
		} else {

			for (int i = 0; i < m; i++) {
				ans = (ans * n)%1000000007;
			}
		}
		ans=ans%1000000007;
		System.out.println(ans);

	}

}

import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;
import static java.lang.Integer.*;
import static java.lang.Double.*;
import java.lang.Math.*;

public class ivan_the_fool_and_the_probability_theory {

	public static void main(String[] args) throws Exception {
		new ivan_the_fool_and_the_probability_theory().run();
	}

	public void run() throws Exception {
		FastIO file = new FastIO();
		int n = file.nextInt();
		int m = file.nextInt();
		int[] f = new int[n + m + 2];
		f[1] = 1;
		for (int i = 2; i < n + m + 2; i++) {
			f[i] = (f[i - 1] + f[i - 2]) % (1000000007);
		}
		System.out.println(2 * (f[n + 1] + f[m + 1] - 1));
		file.out.flush();
	}

	public static class FastIO {
		BufferedReader br;
		StringTokenizer st;
		PrintWriter out;

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		void print(Object o) {
			out.print(o);
		}

		void println(Object o) {
			out.println(o);
		}

		void printf(String s, Object... o) {
			out.printf(s, o);
		}
	}

	public static long pow(long n, long p, long mod) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, (p - 1) / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	}

	public static long pow(long n, long p) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, (p - 1) / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	}

	public static long gcd(long x, long y) {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	}

	public static boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}
}

//package CodeforcesProject;

import java.io.*;
import java.lang.*;
import java.util.*;

public class Main extends IO {

    public static void main(String[] args) throws Exception {
        ((Array)(int[] array) -> System.out.print(2 * (array[0] + array[1] - 1))).useArray(readArrayInt(" "));
    }
}

class math {

    protected static int gcd(int a, int b) { // NOD
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static float gcd(float a, float b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static double gcd(double a, double b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    protected static double lcm(double a, double b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static float lcm(float a, float b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static int lcm(int a, int b) { // NOK
        return a / gcd(a, b) * b;
    }

    protected static long lcm(long a, long b) {
        return a / gcd(a, b) * b;

    }
}

class Division<T extends Number> extends Pair {

    private Division(T dividend, T divider) {
        super(dividend, divider);
        reduce();
    }

    protected static <T extends Number> Division<T> createDivision(T dividend, T divider) {
        return new Division<>(dividend, divider);
    }

    protected void reduce() {
        if (getFirstElement() instanceof Integer) {
            Integer Dividend = (Integer) getFirstElement();
            Integer Divider = (Integer) getSecondElement();
            int gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Long) {
            Long Dividend = (Long) getFirstElement();
            Long Divider = (Long) getSecondElement();
            long gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Float) {
            Float Dividend = (Float) getFirstElement();
            Float Divider = (Float) getSecondElement();
            float gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        } else if (getFirstElement() instanceof Double) {
            Double Dividend = (Double) getFirstElement();
            Double Divider = (Double) getSecondElement();
            double gcd = math.gcd(Dividend, Divider);
            setFirst(Dividend / gcd);
            setSecond(Divider / gcd);
        }
    }

    protected void addWithoutReturn(Division number) throws UnsupportedOperationException {
        add(number, 0);
    }

    private Division add(Division number, int function) throws UnsupportedOperationException {
        if (getFirstElement() instanceof Integer && number.getFirstElement() instanceof Integer) {
            Integer Dividend = (Integer) getFirstElement();
            Integer Divider = (Integer) getSecondElement();
            Integer Dividend1 = (Integer) number.getFirstElement();
            Integer Divider1 = (Integer) number.getSecondElement();
            Integer lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;

        } else if (getFirstElement() instanceof Long && number.getFirstElement() instanceof Long) {
            Long Dividend = (Long) getFirstElement();
            Long Divider = (Long) getSecondElement();
            Long Dividend1 = (Long) number.getFirstElement();
            Long Divider1 = (Long) number.getSecondElement();
            Long lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else if (getFirstElement() instanceof Float && number.getFirstElement() instanceof Float) {
            Float Dividend = (Float) getFirstElement();
            Float Divider = (Float) getSecondElement();
            Float Dividend1 = (Float) number.getFirstElement();
            Float Divider1 = (Float) number.getSecondElement();
            Float lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else if (getFirstElement() instanceof Double && number.getFirstElement() instanceof Double) {
            Double Dividend = (Double) getFirstElement();
            Double Divider = (Double) getSecondElement();
            Double Dividend1 = (Double) number.getFirstElement();
            Double Divider1 = (Double) number.getSecondElement();
            Double lcm = math.lcm(Divider, Divider1);
            if (function == 0) {
                setFirst((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1);
                setSecond(lcm);
                reduce();
                return null;
            }
            Division result = Division.createDivision((lcm / Divider) * Dividend + (lcm / Divider1) * Dividend1, lcm);
            result.reduce();
            return result;
        } else {
            throw new UnsupportedOperationException();
        }
    }

    protected Division addWithReturn(Division number) {
        return add(number, 1);
    }

    protected void multiplyWithoutReturn(Division number) throws UnsupportedOperationException {
        multiply(number, 0);
    }

    protected Division multiplyWithReturn(Division number) throws UnsupportedOperationException {
        return multiply(number, 1);
    }

    private Division multiply(Division number, int function) throws UnsupportedOperationException {
        if (getFirstElement() instanceof Integer && number.getFirstElement() instanceof Integer) {
            Integer first = (Integer) getFirstElement() * (Integer) number.getFirstElement();
            Integer second = (Integer) getSecondElement() * (Integer) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else if (getFirstElement() instanceof Long && number.getFirstElement() instanceof Long) {
            Long first = (Long) getFirstElement() * (Long) number.getFirstElement();
            Long second = (Long) getSecondElement() * (Long) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;

        } else if (getFirstElement() instanceof Float && number.getFirstElement() instanceof Float) {
            Float first = (Float) getFirstElement() * (Float) number.getFirstElement();
            Float second = (Float) getSecondElement() * (Float) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else if (getFirstElement() instanceof Double && number.getFirstElement() instanceof Double) {
            Double first = (Double) getFirstElement() * (Double) number.getFirstElement();
            Double second = (Double) getSecondElement() * (Double) number.getSecondElement();
            if (function == 0) {
                setFirst(first);
                setSecond(second);
                reduce();
                return null;
            }
            Division answer = Division.createDivision(first, second);
            answer.reduce();
            return answer;
        } else {
            throw new UnsupportedOperationException();
        }
    }
}

class Pair<T, T1> {

    private T first;
    private T1 second;

    Pair(T obj, T1 obj1) {
        first = obj;
        second = obj1;
    }

    protected static <T, T1> Pair<T, T1> createPair(T element, T1 element1) {
        return new Pair<>(element, element1);
    }

    protected T getFirstElement() {
        return first;
    }

    protected T1 getSecondElement() {
        return second;
    }

    protected void setFirst(T element) {
        first = element;
    }

    protected void setSecond(T1 element) {
        second = element;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Pair)) {
            return false;
        }
        Pair pair = (Pair) obj;
        return first == pair.first && second == pair.second;
    }

    @Override
    public int hashCode() {
        return 1;
    }
}

class Graph {

    private int[][] base;
    private boolean[] used;
    private int quantity;
    private Integer[] ancestor;

    public int[][] getBase() {
        return base.clone();
    }

    public boolean[] getUsed() {
        return used.clone();
    }

    public int getQuantity() {
        return quantity;
    }

    public Integer[] getAncestor() {
        return ancestor.clone();
    }

    public void start(int length) {
        used = new boolean[length];
        ancestor = new Integer[length];
        ancestor[0] = -1;
        quantity = 0;
    }

    public void ribMatrixToDefault(int length, int quantity, boolean readConsole, int[][] value) throws Exception {
        base = new int[length][];
        List<ArrayList<Integer>> inputBase = new ArrayList<>();
        for (int i = 0; i < length; i++) {
            inputBase.add(new ArrayList<>());
        }
        for (int i = 0; i < quantity; i++) {
            int[] input = readConsole ? IO.readArrayInt(" ") : value[i];
            inputBase.get(input[0] - 1).add(input[1] - 1);
            //inputBase.get(input[0] - 1).add(input[2]); // price
            inputBase.get(input[1] - 1).add(input[0] - 1);
            //inputBase.get(input[1] - 1).add(input[2]); // price
        }
        for (int i = 0; i < length; i++) {
            base[i] = inputBase.get(i).stream().mapToInt(Integer::intValue).toArray();
        }
        start(length);
    }

    public void adjacencyMatrixToDefault(int length, int not, boolean readConsole, int[][] value) throws Exception {
        base = new int[length][];
        List<Integer> buffer = new ArrayList<>();
        int[] InputArray;
        for (int i = 0; i < length; i++) {
            InputArray = readConsole ? IO.readArrayInt(" ") : value[i];
            for (int index = 0; index < length; index++) {
                if (i != index && InputArray[index] != not) {
                    buffer.add(index);
                    // buffer.add(InputArray[index]); // price
                }
            }
            base[i] = buffer.stream().mapToInt(Integer::intValue).toArray();
            buffer.clear();
        }
        start(length);
    }

    public void dfs(int position) throws Exception {
        used[position] = true;
        quantity++;
        int next;
        for (int index = 0; index < base[position].length; index += 2) {
            next = base[position][index];
            if (!used[next]) {
                ancestor[next] = position;
                dfs(next);
            } else {
                if (next != ancestor[position]) { // if cycle
                    throw new Exception();
                }
            }
        }
    }

    public int dijkstra(int start, int stop, int size) {
        start--;
        stop--;
        int[] dist = new int[size];
        for (int i = 0; i < size; i++) {
            if (i != start) {
                dist[i] = Integer.MAX_VALUE;
            }
            ancestor[i] = start;
        }

        Queue<int[]> queue = new PriorityQueue<>(Comparator.comparingInt((int[] ints) -> ints[1]));
        queue.add(new int[]{start, 0});
        int position;
        int[] getQueue;
        while (queue.size() != 0) {
            getQueue = queue.poll();
            position = getQueue[0];
            if (getQueue[1] > dist[position]) {
                continue;
            }
            for (int index = 0; index < base[position].length; index += 2) {
                if (dist[position] + base[position][index + 1] < dist[base[position][index]] && !used[base[position][index]]) {
                    dist[base[position][index]] = dist[position] + base[position][index + 1];
                    ancestor[base[position][index]] = position;
                    queue.add(new int[]{base[position][index], dist[base[position][index]]});
                }
            }
            used[position] = true;
        }
        return dist[stop] == Integer.MAX_VALUE ? -1 : dist[stop];
    }

    public static boolean floydWarshall(int[][] base, int length, int not) {
        for (int k = 0; k < length; k++) {
            for (int i = 0; i < length; i++) {
                for (int j = 0; j < length; j++) {
                    if (base[i][k] == not || base[k][j] == not) {
                        continue;
                    }
                    int total = base[i][k] + base[k][j];
                    if (base[i][j] != not) {
                        base[i][j] = Math.min(base[i][j], total);
                    } else {
                        base[i][j] = total;
                    }
                }
            }
        }
        for (int index = 0; index < length; index++) {
            if (base[index][index] != 0) { // if cycle
                return false;
            }
        }
        return true;
    }
}

interface Array {
    void useArray(int[] a);
}

interface Method {
    void use();
}

class FastSort {

    protected static void sortWithoutReturn(int[] array, int length, int ShellHeapMergeMyInsertionSort) {
        sort(array, ShellHeapMergeMyInsertionSort, length);
    }

    protected static int[] sortWithReturn(int[] array, int length, int ShellHeapMergeMyInsertionSort) {
        int[] base = array.clone();
        sort(base, ShellHeapMergeMyInsertionSort, length);
        return base;
    }

    private static void sort(int[] array, int ShellHeapMergeMyInsertionSort, int length) {
        if (ShellHeapMergeMyInsertionSort < 0 || ShellHeapMergeMyInsertionSort > 4) {
            Random random = new Random();
            ShellHeapMergeMyInsertionSort = random.nextInt(4);
        }
        if (ShellHeapMergeMyInsertionSort == 0) {
            ShellSort(array);
        } else if (ShellHeapMergeMyInsertionSort == 1) {
            HeapSort(array);
        } else if (ShellHeapMergeMyInsertionSort == 2) {
            MergeSort(array, 0, length - 1);
        } else if (ShellHeapMergeMyInsertionSort == 3) {
            straightMergeSort(array, length);
        } else if (ShellHeapMergeMyInsertionSort == 4) {
            insertionSort(array);
        }
    }

    private static void straightMergeSort(int[] array, int size) {
        if (size == 0) {
            return;
        }
        int length = (size / 2) + ((size % 2) == 0 ? 0 : 1);
        Integer[][] ZeroBuffer = new Integer[length + length % 2][2];
        Integer[][] FirstBuffer = new Integer[0][0];
        for (int index = 0; index < length; index++) {
            int ArrayIndex = index * 2;
            int NextArrayIndex = index * 2 + 1;
            if (NextArrayIndex < size) {
                if (array[ArrayIndex] > array[NextArrayIndex]) {
                    ZeroBuffer[index][0] = array[NextArrayIndex];
                    ZeroBuffer[index][1] = array[ArrayIndex];
                } else {
                    ZeroBuffer[index][0] = array[ArrayIndex];
                    ZeroBuffer[index][1] = array[NextArrayIndex];
                }
            } else {
                ZeroBuffer[index][0] = array[ArrayIndex];
            }
        }
        boolean position = false;
        int pointer0, pointer, pointer1, number = 4, NewPointer, count;
        Integer[][] NewBuffer;
        Integer[][] OldBuffer;
        length = (size / 4) + ((size % 4) == 0 ? 0 : 1);
        while (true) {
            pointer0 = 0;
            count = (number / 2) - 1;
            if (!position) {
                FirstBuffer = new Integer[length + length % 2][number];
                NewBuffer = FirstBuffer;
                OldBuffer = ZeroBuffer;
            } else {
                ZeroBuffer = new Integer[length + length % 2][number];
                NewBuffer = ZeroBuffer;
                OldBuffer = FirstBuffer;
            }
            for (int i = 0; i < length; i++) {
                pointer = 0;
                pointer1 = 0;
                NewPointer = pointer0 + 1;
                if (length == 1) {
                    for (int g = 0; g < size; g++) {
                        if (pointer > count || OldBuffer[pointer0][pointer] == null) {
                            array[g] = OldBuffer[NewPointer][pointer1];
                            pointer1++;
                        } else if (pointer1 > count || OldBuffer[NewPointer][pointer1] == null) {
                            if (OldBuffer[pointer0][pointer] == null) {
                                continue;
                            }
                            array[g] = OldBuffer[pointer0][pointer];
                            pointer++;
                        } else if (OldBuffer[pointer0][pointer] >= OldBuffer[NewPointer][pointer1]) {
                            array[g] = OldBuffer[NewPointer][pointer1];
                            pointer1++;
                        } else {
                            array[g] = OldBuffer[pointer0][pointer];
                            pointer++;
                        }
                    }
                    return;
                }
                for (int g = 0; g < number; g++) {
                    if (pointer > count || OldBuffer[pointer0][pointer] == null) {
                        if (OldBuffer[NewPointer][pointer1] == null) {
                            continue;
                        }
                        NewBuffer[i][g] = OldBuffer[NewPointer][pointer1];
                        pointer1++;
                    } else if (pointer1 > count || OldBuffer[NewPointer][pointer1] == null) {
                        if (OldBuffer[pointer0][pointer] == null) {
                            continue;
                        }
                        NewBuffer[i][g] = OldBuffer[pointer0][pointer];
                        pointer++;
                    } else if (OldBuffer[pointer0][pointer] >= OldBuffer[NewPointer][pointer1]) {
                        NewBuffer[i][g] = OldBuffer[NewPointer][pointer1];
                        pointer1++;
                    } else {
                        NewBuffer[i][g] = OldBuffer[pointer0][pointer];
                        pointer++;
                    }
                }
                pointer0 += 2;
            }
            position = !position;
            length = length / 2 + length % 2;
            number *= 2;
        }
    }

    private static void ShellSort(int[] array) {
        int j;
        for (int gap = array.length / 2; gap > 0; gap /= 2) {
            for (int i = gap; i < array.length; i++) {
                int temp = array[i];
                for (j = i; j >= gap && array[j - gap] > temp; j -= gap) {
                    array[j] = array[j - gap];
                }
                array[j] = temp;
            }
        }
    }

    private static void HeapSort(int[] array) {
        for (int i = array.length / 2 - 1; i >= 0; i--)
            shiftDown(array, i, array.length);
        for (int i = array.length - 1; i > 0; i--) {
            swap(array, 0, i);
            shiftDown(array, 0, i);
        }
    }

    private static void shiftDown(int[] array, int i, int n) {
        int child;
        int tmp;
        for (tmp = array[i]; leftChild(i) < n; i = child) {
            child = leftChild(i);
            if (child != n - 1 && (array[child] < array[child + 1]))
                child++;
            if (tmp < array[child])
                array[i] = array[child];
            else
                break;
        }
        array[i] = tmp;
    }

    private static int leftChild(int i) {
        return 2 * i + 1;
    }

    private static void swap(int[] array, int i, int j) {
        int temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }

    private static void MergeSort(int[] array, int low, int high) {
        if (low < high) {
            int mid = (low + high) / 2;
            MergeSort(array, low, mid);
            MergeSort(array, mid + 1, high);
            merge(array, low, mid, high);
        }
    }

    private static void merge(int[] array, int low, int mid, int high) {
        int n = high - low + 1;
        int[] Temp = new int[n];
        int i = low, j = mid + 1;
        int k = 0;
        while (i <= mid || j <= high) {
            if (i > mid)
                Temp[k++] = array[j++];
            else if (j > high)
                Temp[k++] = array[i++];
            else if (array[i] < array[j])
                Temp[k++] = array[i++];
            else
                Temp[k++] = array[j++];
        }
        for (j = 0; j < n; j++)
            array[low + j] = Temp[j];
    }

    private static void insertionSort(int[] elements) {
        for (int i = 1; i < elements.length; i++) {
            int key = elements[i];
            int j = i - 1;
            while (j >= 0 && key < elements[j]) {
                elements[j + 1] = elements[j];
                j--;
            }
            elements[j + 1] = key;
        }
    }
}

class IO {

    private static BufferedReader read;
    private static boolean FileInput = false;
    private static BufferedWriter write;
    private static boolean FileOutput = false;

    public static void setFileInput(boolean fileInput) {
        FileInput = fileInput;
    }

    public static void setFileOutput(boolean fileOutput) {
        FileOutput = fileOutput;
    }

    private static void startInput() {
        try {
            read = new BufferedReader(FileInput ? new FileReader("input.txt") : new InputStreamReader(System.in));
        } catch (Exception error) {
        }
    }

    private static void startOutput() {
        try {
            write = new BufferedWriter(FileOutput ? new FileWriter("output.txt") : new OutputStreamWriter(System.out));
        } catch (Exception error) {
        }
    }

    protected static int readInt() throws Exception {
        if (read == null) {
            startInput();
        }
        return Integer.parseInt(read.readLine());
    }

    protected static long readLong() throws Exception {
        if (read == null) {
            startInput();
        }
        return Long.parseLong(read.readLine());
    }

    protected static String readString() throws Exception {
        if (read == null) {
            startInput();
        }
        return read.readLine();
    }

    protected static int[] readArrayInt(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return Arrays.stream(read.readLine().split(split)).mapToInt(Integer::parseInt).toArray();
    }

    protected static long[] readArrayLong(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return Arrays.stream(read.readLine().split(split)).mapToLong(Long::parseLong).toArray();
    }

    protected static String[] readArrayString(String split) throws Exception {
        if (read == null) {
            startInput();
        }
        return read.readLine().split(split);
    }

    protected static void writeArray(int[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Integer.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(Integer[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Integer.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(long[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Long.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    protected static void writeArray(Long[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Long.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception error) {
        }
    }

    public static void writeArray(String[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(array[index]);
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception ignored) {
        }
    }

    protected static void writeArray(boolean[] array, String split, boolean enter) {
        if (write == null) {
            startOutput();
        }
        try {
            int length = array.length;
            for (int index = 0; index < length; index++) {
                write.write(Boolean.toString(array[index]));
                if (index + 1 != length) {
                    write.write(split);
                }
            }
            if (enter) {
                writeEnter();
            }
        } catch (Exception ignored) {
        }
    }

    protected static void writeInt(int number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Integer.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeInt(Integer number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Integer.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeLong(long number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Long.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeLong(Long number, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(Long.toString(number));
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeString(String word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeBoolean(boolean value, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(value ? "true" : "false");
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeBoolean(Boolean value, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(value ? "true" : "false");
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeChar(char word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeChar(Character word, String end) {
        if (write == null) {
            startOutput();
        }
        try {
            write.write(word);
            write.write(end);
        } catch (Exception ignored) {
        }
    }

    protected static void writeEnter() {
        if (write == null) {
            startOutput();
        }
        try {
            write.newLine();
        } catch (Exception ignored) {
        }
    }

    protected static void print(boolean exit) throws Exception {
        if (exit) {
            print();
        } else {
            write.flush();
        }
    }

    protected static void print() throws Exception {
        if (write == null) {
            return;
        }
        write.flush();
        read.close();
        write.close();
    }
}

/**
 * @author Juan Sebastian Beltran Rojas
 * @mail jsbeltran.valhalla@gmail.com
 * @veredict
 * @url
 * @category
 * @date
 **/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

public class CF1239A {
    static long MOD = 1000000007;
    static int N, M;
    static long[] mem;

    public static void main(String args[]) throws Throwable {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for (String ln; (ln = in.readLine()) != null; ) {
            StringTokenizer st = new StringTokenizer(ln);
            N = parseInt(st.nextToken());
            M = parseInt(st.nextToken());
            mem = new long[Math.max(M,N)+1];
            System.out.println(2*f(N)+2*f(M)-2);
        }
    }

    static long f(int p) {
        if (p == 0) return 1;
        if (p <0) return 0;
        if(mem[p]>0)return mem[p];
        return mem[p]=(f(p - 1) + f(p - 2)) % MOD;
    }
}

/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
*/
import java.util.*;
import java.io.*;

   public class C
   {
      public static void main(String args[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int M = Integer.parseInt(st.nextToken());
         long res = 0L;
         long[] fac = new long[100001];
         long MOD = 1000000007L;
         //factorials
         fac[0] = 1;
         fac[1] = 1;
         for(int i=2; i < fac.length; i++)
            fac[i] = (fac[i-1]*i)%MOD;
         //bar from N
         for(int i=0; i <= N/2; i++)
         {
            long permute = i+1;
            if(i*2 == N) //no checkerboard
               permute = 1;
            res += 2*permute;
            res %= MOD;
         }
         //from M
         for(int i=0; i <= M/2; i++)
         {
            long permute = i+1;
            if(i*2 == M)
               permute = 1;
            res += 2*permute;
            res %= MOD;
         }
         res -= 2;
         System.out.println(res%MOD);
      }
      public static long power(long x, long y, long p)
       {
           // Initialize result
           long res = 1L;

           // Update x if it is more
           // than or equal to p
           x = x % p;

           while (y > 0)
           {
               // If y is odd, multiply x
               // with result
               if((y & 1)==1)
                   res = (res * x) % p;

               // y must be even now
               // y = y / 2
               y = y >> 1;
               x = (x * x) % p;
           }
           return res;
       }
    }

import java.io.*;
import java.util.*;

public class main {
	static final int MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());

		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		long ans = n*2;
		ans %= MOD;
		ans += (m-1)*2;
		ans %= MOD;
		System.out.println(ans);
	}
}

import java.io.*;
import java.util.*;

public class IvanFool {

	static FastReader sc=new FastReader();

	public static final long MOD=1000000007;

	void run() {
	    int n=sc.nextInt();
	    int m=sc.nextInt();

	    long fib[]=new long[100003];
	    fib[1]=1;
	    fib[2]=2;
	    for(int i=3;i<=Math.max(n,m);i++){
	        fib[i]=(fib[i-1]+fib[i-2])%MOD;
	    }
	    long res=(2*((fib[n]+fib[m])%MOD-1))%MOD;
	    System.out.println(res);
	}

	public static void main(String args[]) throws IOException {
		new IvanFool().run();
	}

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class Pair<A, B> {
	A first;
	B second;

	Pair(A first, B second) {
		this.first = first;
		this.second = second;
	}

}

class TaskB {
	long INF = (long) 1e18 + 5;
	long mod = (long) 1e18 + 7;

	public void solve(int testNumber, InputReader in, PrintWriter pw) {
		int N = in.nextInt();
		int M = in.nextInt();
		long ans = (2 * ((fib(N) + fib(M)) - 1)) % mod;
		pw.println(ans);
//
//		for (int i = 0; i < N; i++) {
//			pw.println(Arrays.toString(dp[i]));
//		}
	}

	long fib(int N) {
		long fib[] = new long[N + 1];
		fib[0] = 1;
		fib[1] = 1;
		for (int i = 2; i <= N; i++) {
			fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
		}
		return fib[N] % mod;
	}

	long sum(int i, int j, long arr[]) {
		long sum = 0;
		for (int k = i; k <= j; k++) {
			sum += arr[k];
		}
		return sum;
	}

	boolean FirstRow_Col(Pair<Integer, Integer> pair) {
		return pair.first == 0 || pair.second == 0;
	}

	int __gcd(int a, int b) {
		if (b == 0)
			return a;
		return __gcd(b, a % b);

	}

	public int getInt(int num) {
		int ret = -1;
		switch (num) {
		case 0:
			ret = 6;
			break;
		case 1:
			ret = 2;
			break;
		case 2:
			ret = 5;
			break;
		case 3:
			ret = 5;
			break;
		case 4:
			ret = 4;
			break;
		case 5:
			ret = 5;
			break;
		case 6:
			ret = 6;
			break;
		case 7:
			ret = 3;
			break;
		case 8:
			ret = 7;
			break;
		case 9:
			ret = 6;
			break;
		}
		return ret;
	}

	public int isPow(long num) {
		int count = 0;
		while (num > 0) {
			num /= 2;
			count++;
		}
		return count;
	}
}

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CIvanTheFoolAndTheProbabilityTheory solver = new CIvanTheFoolAndTheProbabilityTheory();
        solver.solve(1, in, out);
        out.close();
    }

    static class CIvanTheFoolAndTheProbabilityTheory {
        static int r;
        static int c;
        static int mod = (int) 1e9 + 7;
        static Integer memo[][][];
        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            r = sc.nextInt();
            c = sc.nextInt();
            memo = new Integer[3][3][c + 1];
            pw.println((dp(0, 0, 0) + (r == 2 ? 2 : 0)) % mod);
        }

        private int dp(int i, int white, int black) {
            if (i == c)
                return 1;
            if (memo[white][black][i] != null)
                return memo[white][black][i];
            int blackk = 0, whitee = 0;
            if (black < 2)
                blackk = dp(i + 1, Math.max(0, white - 1), black + 1);
            if (white < 2)
                whitee = dp(i + 1, white + 1, Math.max(0, black - 1));
            return memo[white][black][i] = (blackk + whitee) % mod;
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.util.*;
import java.io.*;

public class Main {

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public float nextFloat() {
            return Float.parseFloat(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] intArray = new int[n];
            for (int i = 0; i < n; i++) {
                intArray[i] = nextInt();
            }
            return intArray;
        }
    }

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        int q = 1;
        for (int i = 0; i < q; i++) {
            solver.solve(i + 1, in, out);
        }
        out.close();
    }

    static class Task {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            if (n < m) {
                n ^= m;
                m ^= n;
                n ^= m;
            }
            int[] F = new int[n + 2];
            F[0] = 0;
            F[1] = 1;
            for (int i = 2; i < n + 2; i++) {
                F[i] = F[i - 1] + F[i - 2];
            }
            out.println(2 * (F[n + 1] + F[m + 1] - 1));
        }
    }
}

//package div3;

import java.io.*;
import java.util.List;
import java.util.StringTokenizer;

public class board
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    static void print(List<Integer> l){
        for(int ele:l){
            System.out.print(ele+" ");
        }
        System.out.println();
    }
    static Integer[][][] dp;
    static int mod = (int)(1e9+7);
    static int add(int a,int b){
        return (a%mod+b%mod)%mod;
    }
    static int mul(int a,int b){
        return (a%mod * b%mod)%mod;
    }
    private static int go(int blacks,int whites,int index,int m){
        if(index >= m)return 1;
        if(dp[index][blacks][whites] != null)return dp[index][blacks][whites];
        int count = 0;
        //System.out.println(blacks+" "+whites);
        if(blacks >= 2){
            count = add(count,go(0,1,index+1,m));
        }
        else if(whites >= 2){
            count = add(count,go(1,0,index+1,m));
        }
        else{
            count = add(go(blacks+1,0,index+1,m) , go(0,whites+1,index+1,m));
        }

        return dp[index][blacks][whites] = count;
    }
    public static void main(String[] args)
    {
        FastReader sc=new FastReader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        //int t  = sc.nextInt();

        int n = sc.nextInt();
        int m = sc.nextInt();
        dp = new Integer[m][4][4];
        int[] pow = new int[Math.max(n+1,m+1)];
        int[] cal = new int[Math.max(n+1,m+1)];

        cal[1] = 2;
        if(Math.max(m,n)>=2)
        cal[2] = 4;
        for(int i=3;i<=Math.max(m,n);i++){
            cal[i] = add(cal[i-1],cal[i-2]);
        }
        pow[0] = 1;
        for(int i=1;i<=Math.max(n,m);i++){
            pow[i] = mul(pow[i-1],2);
        }
        int ways = cal[m];
        if(m == 1){
            System.out.println(cal[n]);
        }
        else {
            //System.out.println(go(0,0,0,m));
            //System.out.println(ways+" "+pow[n]);
            System.out.println((ways - 2) + cal[n]);
        }
        //out.close();

    }
}

import java.util.*;

import java.io.*;

public class dp_12 {

	static Scanner sc;
	static long modpower(long x, long y, long p)
    {
        long res = 1;

        x = x % p;

        while (y > 0)
        {

            if (y % 2 == 1)
                res = (res * x) % p;

            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }

        return res;
    }

	static void solve() {
	int mod=1000000007;

		int r=sc.nextInt();
		int c=sc.nextInt();
		int temp;long temp1;

		temp=(int)Math.max(r, c);
//		temp1=Math.min(r, c);
//		r=temp;c=temp1;

		if (r==1 && c==1) { System.out.println(2);return;}

		else {

		int[] fib=new int[temp+1];
		fib[0]=1;
		fib[1]=1;
		for( int i=2;i<=temp;i++) {
			fib[i]=(fib[i-1]%mod+fib[i-2]%mod)%mod;
		}
		System.out.println((2*(fib[r]+fib[c]-1))%mod);
		}

	}

	public static void main(String[] args) throws Exception {
		sc = new Scanner(System.in);
		int q = 1;

		while (q-- > 0) solve();
	}
}

//package div3;

import java.io.*;
import java.util.List;
import java.util.StringTokenizer;

public class board
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    static void print(List<Integer> l){
        for(int ele:l){
            System.out.print(ele+" ");
        }
        System.out.println();
    }
    static Integer[][][] dp;
    static int mod = (int)(1e9+7);
    static int add(int a,int b){
        return (a%mod+b%mod)%mod;
    }
    static int mul(int a,int b){
        return (a%mod * b%mod)%mod;
    }
    private static int go(int blacks,int whites,int index,int m){
        if(index >= m)return 1;
        if(dp[index][blacks][whites] != null)return dp[index][blacks][whites];
        int count = 0;
        //System.out.println(blacks+" "+whites);
        if(blacks >= 2){
            count = add(count,go(0,1,index+1,m));
        }
        else if(whites >= 2){
            count = add(count,go(1,0,index+1,m));
        }
        else{
            count = add(go(blacks+1,0,index+1,m) , go(0,whites+1,index+1,m));
        }

        return dp[index][blacks][whites] = count;
    }
    public static void main(String[] args)
    {
        FastReader sc=new FastReader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        //int t  = sc.nextInt();

        int n = sc.nextInt();
        int m = sc.nextInt();
        dp = new Integer[m][4][4];
        int[] pow = new int[n+1];
        int[] cal = new int[m+1];

        cal[1] = 2;
        if(m-1>=2)
        cal[2] = 4;
        for(int i=3;i<=m;i++){
            cal[i] = add(cal[i-1],cal[i-2]);
        }
        pow[0] = 1;
        for(int i=1;i<=n;i++){
            pow[i] = mul(pow[i-1],2);
        }
        int ways = cal[m];
        //System.out.println(go(0,0,0,m));
        //System.out.println(ways+" "+pow[n]);
        System.out.println((ways-2) + (pow[n]));

        //out.close();

    }
}

import java.util.*;
import java.io.*;

public class ProbTheory {
    final static long MODULO = (long)(1e9+7);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("ProbTheory.out");

        int n = sc.nextInt();
        int m = sc.nextInt();

        long a = 1;
        long b = 1;
        long ans = 1;
        long endAns = 0;

        for(int i = 1; i<=Math.max(n,m); i++){
            if(i == n || i == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            ans = ((a % MODULO) + (b % MODULO)) % MODULO;
            a = b;
            b = ans;
        }
        endAns--;
        endAns = ((endAns % MODULO) * 2) % MODULO;

        System.out.println(endAns);

    }
}

import java.util.*;
import java.io.*;

public class CF {

  static int n, m;
  static int mod=(int)1e9+7;
  static int ans[] = new int[100001];

  static void solve() {
    ans[0] =1 ;
    ans[1] =1 ;
    ans[2] =2;
    for (int i = 3; i < 100001; i++)
      ans[i] =( ans[i - 1] %mod + ans[i - 2] %mod) % mod;
  }

  public static void main(String[] arg) throws Exception{
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    String s[] = bf.readLine().trim().split("\\s+");
    n = Integer.parseInt(s[0]);
    m = Integer.parseInt(s[1]);
    solve();
    System.out.println(2 * (ans[n] + ans[m] - 1));
  }
}

import java.awt.*;
import java.io.*;
import java.util.*;

public class Abc {
    public static void main(String[] args) throws Exception {
        FastReader sc = new FastReader();
        int mod=1000000007;
        long n=sc.nextInt(),m=sc.nextInt();
        if (n==m && n==1){
            System.out.println(2);
            return;
        }
        System.out.println((n*m+2)%mod);

    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * Created by Katushka on 20.10.2019.
 */
public class IvanTheFoolProbability {

    final static long MOD = 1000000007;

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n1 = in.nextInt();
        int m1 = in.nextInt();

        int n = Math.min(n1, m1);
        int m = Math.max(n1, m1);

        if (n == 1 && m == 1) {
            System.out.println(2);
            return;
        }

        long[][] firstRowDP = new long[m][4];
        firstRowDP[1][0] = 1;
        firstRowDP[1][1] = 1;
        firstRowDP[1][2] = 1;
        firstRowDP[1][3] = 1;

        for (int i = 2; i < m; i++) {
            firstRowDP[i][0] = firstRowDP[i - 1][2];
            firstRowDP[i][1] = (firstRowDP[i - 1][0] + firstRowDP[i - 1][2]) % MOD;
            firstRowDP[i][2] = (firstRowDP[i - 1][1] + firstRowDP[i - 1][3]) % MOD;
            firstRowDP[i][3] = firstRowDP[i - 1][1];
        }

        System.out.println((firstRowDP[m - 1][0] + firstRowDP[m - 1][1] + firstRowDP[m - 1][2] + firstRowDP[m - 1][3] + (n > 1 ? 2 : 0)) % MOD);

    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    final String str = reader.readLine();
                    tokenizer = new StringTokenizer(str);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.Arrays;

public class Solution {
	public static void main(String[] args) throws IOException {
	    // Read inputs
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());

		// Wlog n > m
		if(n< m){
		    int temp = m;
		    m = n;
		    n = temp;
		}
		long[] dp = new long[n];
		dp[0] = 1;
		if(n<2){
		    System.out.println(1);
		    return;
		}
		dp[1] = 2;
		for(int i = 2; i< n; i++){
		    dp[i] = (dp[i-1] + dp[i-2]) % (1000000000+7);
		}
		long ans = ((dp[n-1] * 2)% (1000000000+7)) + ((dp[m-1] * 2)% (1000000000+7)) - 2;

	    System.out.println(ans % (1000000000+7));
	}
}

import java.util.*;

public class IvanTheFool {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();

		long ans = 1;

		if (n == 1 || m == 1) {
			if (n == 1) {
				ans = m * 2;
			} else {
				ans = n * 2;
			}
		} else {

			ans=(m*n)%1000000007;
			ans=ans+Math.min(m, n);
		}
		ans=ans%1000000007;
		System.out.println(ans);

	}

}

// Why do we fall ? So we can learn to pick ourselves up.
// http://tech-queries.blogspot.com/2011/07/fit-12-dominos-in-2n-strip.html
import java.util.*;
public class solve {
    static int mod = 1000000007;
    public static void main(String[] args) {
        int[] fib = new int[100001];
        fib[1] = 1;
        fib[2] = 2;
        for(int i=3; i<100001; i++) {
            fib[i] = (fib[i - 1] + fib[i - 2])%mod;
        }
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        System.out.println(2*(fib[n]+fib[m]-1)%mod);
    }
}

import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(System.out);

        String str[]=br.readLine().split(" ");
        int n=Integer.parseInt(str[0]);
        int m=Integer.parseInt(str[1]);
        pw.println(1L*n*m+2);
        pw.flush();
        pw.close();
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CIvanTheFoolAndTheProbabilityTheory solver = new CIvanTheFoolAndTheProbabilityTheory();
        solver.solve(1, in, out);
        out.close();
    }

    static class CIvanTheFoolAndTheProbabilityTheory {
        static int[] memo;
        static int mod = (int) 1e9 + 7;

        public int fib(int x) {
            if (x < 2)
                return 1;
            if (memo[x] != 0)
                return memo[x];
            return memo[x] = (fib(x - 1) + fib(x - 2)) % mod;
        }

        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int r = sc.nextInt(), c = sc.nextInt();
            memo = new int[Math.max(r, c) + 1];
            pw.println((2 * (fib(r) + fib(c) - 1)) % mod);
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static final long mod = (long) (1e9 + 7);

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[][] = new long[n][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < n; i++) {
            dp[i][0] = (dp[i - 1][0] + dp[i - 1][1])%mod;
            dp[i][1] = dp[i - 1][0];
        }
        long ans = (dp[n - 1][0] + dp[n - 1][1] - 1)%mod;
        ans = ans * 2;
        ans = ans%mod;
        dp = new long[m][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < m; i++) {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][0];
        }
        long ans2 = (dp[m - 1][0] + dp[m - 1][1] - 1)%mod;
        ans2 = ans2 * 2;
        ans2 = ans2%mod;
        pw.println((ans + ans2 + 2)%mod);
        pw.close();
    }
}

import java.util.*;
import java.io.*;

public class ProbTheory {
    final static long MODULO = (long)(1e9+7);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("ProbTheory.out");

        int n = sc.nextInt();
        int m = sc.nextInt();

        long a = 1;
        long b = 1;
        long ans = 1;
        long endAns = 0;

        for(int i = 1; i<=Math.max(n,m); i++){
            if(i == n && n == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            else if(i == n || i == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            ans = ((a % MODULO) + (b % MODULO)) % MODULO;
            a = b;
            b = ans;
        }
        endAns--;
        endAns = ((endAns % MODULO) * 2) % MODULO;

        System.out.println(endAns);

    }
}

import java.util.*;
import java.io.*;
public class Main {
    static class Scan {
        private byte[] buf=new byte[1024];
        private int index;
        private InputStream in;
        private int total;
        public Scan()
        {
            in=System.in;
        }
        public int scan()throws IOException
        {
            if(total<0)
            throw new InputMismatchException();
            if(index>=total)
            {
                index=0;
                total=in.read(buf);
                if(total<=0)
                return -1;
            }
            return buf[index++];
        }
        public int scanInt()throws IOException
        {
            int integer=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    integer*=10;
                    integer+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            return neg*integer;
        }
        public double scanDouble()throws IOException
        {
            double doub=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n)&&n!='.')
            {
                if(n>='0'&&n<='9')
                {
                    doub*=10;
                    doub+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            if(n=='.')
            {
                n=scan();
                double temp=1;
                while(!isWhiteSpace(n))
                {
                    if(n>='0'&&n<='9')
                    {
                        temp/=10;
                        doub+=(n-'0')*temp;
                        n=scan();
                    }
                    else throw new InputMismatchException();
                }
            }
            return doub*neg;
        }
        public String scanString()throws IOException
        {
            StringBuilder sb=new StringBuilder();
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            while(!isWhiteSpace(n))
            {
                sb.append((char)n);
                n=scan();
            }
            return sb.toString();
        }
        private boolean isWhiteSpace(int n)
        {
            if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
            return true;
            return false;
        }
    }

    public static void sort(int arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(int arr[],int l1,int r1,int l2,int r2) {
        int tmp[]=new int[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }

    public static void sort(long arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(long arr[],int l1,int r1,int l2,int r2) {
        long tmp[]=new long[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }
    static int lim;
    static long dp[][],mod;
    public static void main(String args[]) throws IOException {
        Scan input=new Scan();
        int n=input.scanInt();
        int m=input.scanInt();
        long ans=0;
        mod=1000000007;
        if(n!=1) {
            lim=n;
            init();
            ans+=solve(0,0);
        }
        else {
            ans++;
        }
        if(m!=1) {
            lim=m;
            init();
            ans+=solve(0,0);
        }
        else {
            ans++;
        }
        ans%=mod;
        System.out.println(ans);
    }
    public static long solve(int indx,int same) {
        if(indx==lim) {
            return 1;
        }
        if(dp[indx][same]!=-1) {
            return dp[indx][same];
        }
        long ans=0;
        if(same==0) {
            ans+=solve(indx+1,1);
            ans+=solve(indx+1,0);
        }
        if(same==1) {
            ans+=solve(indx+1,0);
        }
        ans%=mod;
        dp[indx][same]=ans;
        return ans;
    }
    public static void init() {
        dp=new long[100001][2];
        for(int i=0;i<dp.length;i++) {
            for(int j=0;j<dp[0].length;j++) {
                dp[i][j]=-1;
            }
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class A3 {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(in, out);
        out.close();
    }

    public static void solve(InputReader sc, PrintWriter pw) {
        int i,j;
        int n = sc.nextInt();
        int m = sc.nextInt(),mod=1000000007;
        int max=Math.max(n,m);
        int f[][]=new int[max+1][4];
        if(max==1)
            pw.println(2);
        else{
            f[2][0]=f[2][1]=f[2][2]=f[2][3]=1;
            for(i=3;i<=max;i++){
                f[i][1]=f[i][2]=(f[i-1][1]+f[i-1][0])%mod;
                f[i][0]=f[i][3]=f[i-1][1];
            }
            pw.println((((f[n][0]+f[n][1])%mod+(f[m][0]+f[m][1])%mod)%mod*2%mod-2+mod)%mod);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}

import java.util.*;

public class IvanTheFool {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();

		long ans = 1;

		if (n == 1 || m == 1) {
			if (n == 1) {
				ans = m * 2;
			} else {
				ans = n * 2;
			}
		} else {

			for (int i = 0; i < m; i++) {
				ans = ans * n;
			}
		}
		ans = ans % 1000000007;
		System.out.println(ans);

	}

}

//package cf594d1;
import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class A {
	static long MOD = 1000000007;
	public static void main(String[] args) {
		MyScanner sc = new MyScanner();
		int n = sc.nextInt(), m = sc.nextInt();
		long[][][] dp = new long[max(n, m)][2][2];
		for(int i = 0; i < 2; i++)
			for(int j = 0; j < 2; j++)
				if(dp.length > 1)
					dp[1][i][j] = 1;
		for(int i = 2; i < dp.length; i++) {
			dp[i][0][0] = dp[i - 1][0][1];
			dp[i][1][1] = dp[i - 1][1][0];
			dp[i][0][1] = (dp[i - 1][1][0] + dp[i - 1][1][1]) % MOD;
			dp[i][1][0] = (dp[i - 1][0][1] + dp[i - 1][0][0]) % MOD;
		}
		long dpN = 0, dpM = 0;
		for(int i = 0; i < 2; i++)
			for(int j = 0; j < 2; j++) {
				dpN = (dpN + dp[n - 1][i][j]) % MOD;
				dpM = (dpM + dp[m - 1][i][j]) % MOD;
			}
		if(n == 1 && m == 1)
			out.println(1);
		else if(n == 1)
			out.println(dpM);
		else if(m == 1)
			out.println(dpN);
		else
			out.println((dpN - 2 + dpM + MOD) % MOD);
		out.close();
	}
	static PrintWriter out  = new PrintWriter(new BufferedOutputStream(System.out));
	static class MyScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;
		String next() {
			while (st == null || !st.hasMoreElements())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}

import java.io.*;
import java.util.StringTokenizer;
public class CF1239A {
    static int MOD=1000000007;
    public static void main(String[] args) throws IOException {
         long[] fib=new long[1000001];
         fib[0]=1;
         fib[1]=2;
         fib[2]=3;
         for (int i = 3; i < 1000001; i++) {
            fib[i]=(fib[i-1]+fib[i-2])%MOD;
        }
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());

        int M=Integer.parseInt(st.nextToken());
        int N=Integer.parseInt(st.nextToken());
        int ans=2;
        for (int i = 0; i <= N-3; i++) {
            ans+=fib[i]; ans%=MOD;
        }
        for (int i = 0; i <= M-3; i++) {
            ans+=fib[i]; ans%=MOD;
        }
        ans*=2; ans%=MOD; ans+=2; ans%=MOD;
        System.out.println(ans);
    }

}

import java.util.*;
import java.io.*;

public class CF {

  static int n, m;
  static int mod=(int)1e9+7;
  static int ans[] = new int[100001];

  static void solve() {
    ans[0] =1 ;
    ans[1] =1 ;
    ans[2] =2;
    for (int i = 3; i < 100001; i++)
      ans[i] =( ans[i - 1] %mod + ans[i - 2] %mod) % mod;
  }

  public static void main(String[] arg) throws Exception{
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    String s[] = bf.readLine().trim().split("\\s+");
    n = Integer.parseInt(s[0]);
    m = Integer.parseInt(s[1]);
    solve();
    System.out.println(2 * (ans[n] + ans[m] - 1));
  }
}

import java.io.*;
import java.util.StringTokenizer;

public class ivanTheFool {
    public static long mod = 1000000000+7;
    public static void fout(long x){
        System.out.println(x);
    }
    /**-----------fast reader------------*/
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    /**-----end of fast reader----------------*/

    public static long pmod(long  x,long  y){
        long r = 1;
        while(y > 0){
            if(y%2 == 1){
                r = (r * x)%mod;
            }
            x = (x * x)%mod;
            y >>= 1;
        }
        return r;
    }

    public static void main(String[] args) {
        FastReader rd = new FastReader();
        long n,m;
        n = rd.nextLong();
        m = rd.nextLong();
        long answer = 0;
        long []fact = new long[(int)Math.max(n,m)+1];
        fact[0] = 1;
        for(long i = 1;i<=Math.max(n,m);++i){
            fact[(int)i] = (fact[(int)i-1]*i)%mod;
        }
        answer += 2;//all adj cells are different
        if(m >= 2){
            long pillars = -1;
            long blocksOf2 = 0;
            for(long blocks = 2;blocks <= m;blocks+=3){
                pillars += 1;
                blocksOf2 += 1;
                long obj = m - (blocksOf2*2) - pillars;
                long bins = blocksOf2+pillars+1;
                if(bins+obj-1 < obj) break;
                answer = (answer + (2*(fact[(int)(bins+obj-1)] * pmod(fact[(int)obj],mod-(long)2)))%mod)%mod;
            }
        }
        if(n >= 2){
            long pillars = -1;
            long blocksOf2 = 0;
            for(long blocks = 2;blocks <= n;blocks+=3){
                pillars += 1;
                blocksOf2 += 1;
                long obj = n - (blocksOf2*2) - pillars;
                long bins = blocksOf2+pillars+1;
                if(bins+obj-1 < obj) break;
                answer = (answer + (2*(fact[(int)(bins+obj-1)] * pmod(fact[(int)obj],mod-(long)2)))%mod)%mod;
            }
        }
        if(m == 1 ^ n == 1){
            answer = (answer + 2)%mod;
        }
        fout(answer);
    }
}

import java.util.*;
import java.io.*;

public class ProbTheory {
    final static long MODULO = (long)(1e9+7);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("ProbTheory.out");

        int n = sc.nextInt();
        int m = sc.nextInt();

        long a = 1;
        long b = 1;
        long ans = 1;
        long endAns = 0;

        for(int i = 1; i<=Math.max(n,m); i++){
            if(i == n && n == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
                //endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            else if (i == m && m == n){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
                //endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            else if(i == n || i == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            ans = ((a % MODULO) + (b % MODULO)) % MODULO;
            a = b;
            b = ans;
        }
        endAns--;
        endAns = ((endAns % MODULO) * 2) % MODULO;

        System.out.println(endAns);

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * Created by Katushka on 20.10.2019.
 */
public class IvanTheFoolProbability {

    final static long MOD = 1000000007;

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n1 = in.nextInt();
        int m1 = in.nextInt();

        int n = Math.min(n1, m1);
        int m = Math.max(n1, m1);

        if (n == 1 && m == 1) {
            System.out.println(2);
            return;
        }

        long[][] firstRowDP = new long[m][4];
        firstRowDP[1][0] = 1;
        firstRowDP[1][1] = 1;
        firstRowDP[1][2] = 1;
        firstRowDP[1][3] = 1;

        for (int i = 2; i < m; i++) {
            firstRowDP[i][0] = firstRowDP[i - 1][2];
            firstRowDP[i][1] = (firstRowDP[i - 1][0] + firstRowDP[i - 1][2]) % MOD;
            firstRowDP[i][2] = (firstRowDP[i - 1][1] + firstRowDP[i - 1][3]) % MOD;
            firstRowDP[i][3] = firstRowDP[i - 1][1];
        }

        System.out.println((firstRowDP[m - 1][0] + firstRowDP[m - 1][1] + firstRowDP[m - 1][2] + firstRowDP[m - 1][3] + (n > 1 ? 2 : 0) + (n > 2 ? 2 : 0)) % MOD);

    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    final String str = reader.readLine();
                    tokenizer = new StringTokenizer(str);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AIvanTheFoolAndTheProbabilityTheory solver = new AIvanTheFoolAndTheProbabilityTheory();
        solver.solve(1, in, out);
        out.close();
    }

    static class AIvanTheFoolAndTheProbabilityTheory {
        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int[] fib = new int[(int) 1e5 + 1];
            fib[0] = fib[1] = 1;
            for (int i = 2; i < fib.length; i++)
                fib[i] = (fib[i - 1] + fib[i - 2]) % ((int) 1e9 + 7);
            pw.println(2l * (fib[n] + fib[m] - 1));
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.util.*;
import java.io.*;
//Captain on duty.

import static java.lang.Math.*;

public class Main {

    static void compare(Main.pair a[], int n) {

        Arrays.sort(a, new Comparator<Main.pair>() {
            @Override
            public int compare(Main.pair p1, Main.pair p2) {
                return p1.f - p2.f;
            }
        });
    }

    public static boolean checkPalindrome(String s) {
        // reverse the given String
        String reverse = new StringBuffer(s).reverse().toString();

        // check whether the string is palindrome or not
        if (s.equals(reverse))
            return true;

        else
            return false;
    }

    static class pair implements Comparable {
        int f;
        int s;

        pair(int fi, int se) {
            f = fi;
            s = se;
        }

        public int compareTo(Object o)//desc order
        {
            pair pr = (pair) o;
            if (s > pr.s)
                return -1;
            if (s == pr.s) {
                if (f > pr.f)
                    return 1;
                else
                    return -1;
            } else
                return 1;
        }

        public boolean equals(Object o) {
            pair ob = (pair) o;
            if (o != null) {
                if ((ob.f == this.f) && (ob.s == this.s))
                    return true;
            }
            return false;
        }

        public int hashCode() {
            return (this.f + " " + this.s).hashCode();
        }

    }

    public static boolean palin(int l, int r, char[] c) {
        while (l <= r) {
            if (c[l] != c[r]) return false;
            l++;
            r--;
        }
        return true;
    }

    public static long gcd(long a, long b) {
        if (b == 0)
            return a;

        return gcd(b, a % b);
    }
    public static long lcm(long a, long b)
    {
        return (a*b)/gcd(a, b);
    }

    public static long hcf(long a, long b) {
        long t;
        while (b != 0) {
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }

    public static boolean isPrime(long n) {
        if (n <= 1)
            return false;

        // Check from 2 to n-1
        for (int i = 2; i <= Math.sqrt(n) + 1; i++)
            if (n % i == 0)
                return false;

        return true;
    }

    public static String reverse(String str) {
        String str1 = "";
        for (int i = 0; i < str.length(); i++) {
            str1 = str1 + str.charAt(str.length() - i - 1);
        }
        return str1;
    }

    public static double fact(long a) {
        if (a == 1)
            return 1;
        else
            return a * fact(a - 1);
    }

    static boolean isPerfectSquare(double x)
    {

        // Find floating point value of
        // square root of x.
        double sr = Math.sqrt(x);

        // If square root is an integer
        return ((sr - Math.floor(sr)) == 0);
    }

    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

    }

    public static void main(String[] args) {
        FastReader s = new FastReader();
        //System.out.println("Forces Babyy!!");

        long n = s.nextLong();
       long m=s.nextLong();
       long ans = 2*(n+m-1);
       if(ans>1000000007)
           ans=ans%1000000007;
       System.out.println(ans);

    }

}

import java.io.*;
import java.util.StringTokenizer;
public class CF1239A {

    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        int M=Integer.parseInt(st.nextToken());
        int N=Integer.parseInt(st.nextToken());
        System.out.println(2*(M+N-1));
    }

}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class Pair<A, B> {
	A first;
	B second;

	Pair(A first, B second) {
		this.first = first;
		this.second = second;
	}

}

class TaskB {
	long INF = (long) 1e18 + 5;
	long mod = (long) 1e9 + 7;

	public void solve(int testNumber, InputReader in, PrintWriter pw) {
		int N = in.nextInt();
		int M = in.nextInt();
		long ans = 2 * ((fib(N) + fib(M)) % mod - 1);
		pw.println(ans);
//
//		for (int i = 0; i < N; i++) {
//			pw.println(Arrays.toString(dp[i]));
//		}
	}

	long fib(int N) {
		long fib[] = new long[N + 1];
		fib[0] = 1;
		fib[1] = 1;
		for (int i = 2; i <= N; i++) {
			fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
		}
		return fib[N] % mod;
	}

	long sum(int i, int j, long arr[]) {
		long sum = 0;
		for (int k = i; k <= j; k++) {
			sum += arr[k];
		}
		return sum;
	}

	boolean FirstRow_Col(Pair<Integer, Integer> pair) {
		return pair.first == 0 || pair.second == 0;
	}

	int __gcd(int a, int b) {
		if (b == 0)
			return a;
		return __gcd(b, a % b);

	}

	public int getInt(int num) {
		int ret = -1;
		switch (num) {
		case 0:
			ret = 6;
			break;
		case 1:
			ret = 2;
			break;
		case 2:
			ret = 5;
			break;
		case 3:
			ret = 5;
			break;
		case 4:
			ret = 4;
			break;
		case 5:
			ret = 5;
			break;
		case 6:
			ret = 6;
			break;
		case 7:
			ret = 3;
			break;
		case 8:
			ret = 7;
			break;
		case 9:
			ret = 6;
			break;
		}
		return ret;
	}

	public int isPow(long num) {
		int count = 0;
		while (num > 0) {
			num /= 2;
			count++;
		}
		return count;
	}
}

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

import java.util.*;
public class IvanTheFool {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int m=sc.nextInt();

		long ans=1;

		for(int i=0;i<m;i++) {
			ans=ans*n;
		}
		ans=ans%1000000007;
		System.out.println(ans);

	}

}

import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter pw;

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int dp[][] = new int[n][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < n; i++) {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][0];
        }
        int ans = dp[n - 1][0] + dp[n - 1][1] - 1;
        if (m != 1) ans = ans * 2;
        dp = new int[m][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < m; i++) {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][0];
        }
        int ans2 = dp[m - 1][0] + dp[m - 1][1] - 1;
        if (n != 1) ans2 = ans2 * 2;
        pw.println(ans + ans2 + 2);
        pw.close();
    }
}

import java.util.*;
import java.io.*;

public class ProbTheory {
    final static long MODULO = (long)(1e9+7);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("ProbTheory.out");

        int n = sc.nextInt();
        int m = sc.nextInt();

        long a = 1;
        long b = 1;
        long ans = 1;
        long endAns = 0;

        for(int i = 1; i<=Math.max(n,m); i++){
            if(i == n || i == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            ans = ((a % MODULO) + (b % MODULO)) % MODULO;
            a = b;
            b = ans;
        }
        endAns--;
        endAns = ((endAns % MODULO) * 2) % MODULO;

        System.out.println(endAns);

    }
}

import java.util.*;
import java.io.*;

public class ProbTheory {
    final static long MODULO = (long)(1e9+7);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("ProbTheory.out");

        int n = sc.nextInt();
        int m = sc.nextInt();

        long a = 1;
        long b = 1;
        long ans = 1;
        long endAns = 0;

        for(int i = 1; i<=Math.max(n,m); i++){
            if(i == n && n == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            else if(i == n || i == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            ans = ((a % MODULO) + (b % MODULO)) % MODULO;
            a = b;
            b = ans;
        }
        endAns--;
        endAns = ((endAns % MODULO) * 2) % MODULO;

        System.out.println(endAns);

    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CIvanTheFoolAndTheProbabilityTheory solver = new CIvanTheFoolAndTheProbabilityTheory();
        solver.solve(1, in, out);
        out.close();
    }

    static class CIvanTheFoolAndTheProbabilityTheory {
        static int[] memo;
        static int mod = (int) 1e9 + 7;

        public int fib(int x) {
            if (x < 2)
                return 1;
            if (memo[x] != 0)
                return memo[x];
            return memo[x] = (fib(x - 1) + fib(x - 2)) % mod;
        }

        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int r = sc.nextInt(), c = sc.nextInt();
            memo = new int[Math.max(r, c) + 1];
            pw.println((2 * (fib(r) + fib(c) - 1)) % mod);
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.io.*;
import java.util.*;

public class Main {
    static int inf = (int) 1e9 + 7;

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(System.out);
        int n = nextInt();
        int m = nextInt();
        int ans1 = 1;
        for(int i = 0;i < n - 2;i++) {
            ans1 = (ans1 * 2) % inf;
        }
        int ans2 = 1;
        for(int i = 0;i < m - 2;i++) {
            ans2 = (ans2 * 2) % inf;
        }
        int ans3 = (ans1 + ans2 + 1) % inf;
        pw.println(ans3 * 2 % inf);
        pw.close();
    }

    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");
    static PrintWriter pw;

    static String next() throws IOException {
        while (!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

}

import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    static long inf = Long.MAX_VALUE / 2;
    static int mod = (int) 1e9 + 7;

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        int n = nextInt();
        int m = nextInt();
        long[] dp = new long[100002];
        dp[0] = 1;
        dp[1] = 1;
        for (int i = 2; i < 100002; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        out.print(2 * (dp[n] + dp[m] - 1));
        out.close();
    }

    static PrintWriter out;
    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static String next() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}