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());
        }

    }

}