#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long int p1 = 0, p2 = 0;
  long long int a = 0;
  cin >> n >> m;
  if (n == 1) {
    p1 = 4;
    p2 = 2;
    if (m == 1) {
      cout << 2 << endl;
    } else if (m == 2) {
      cout << 4 << endl;
    } else {
      for (int i = 2; i < m; i++) {
        a = p1 + p2;
        p2 = p1;
        p1 = a;
        a %= 1000000007;
        p1 %= 1000000007;
        p2 %= 1000000007;
      }
      cout << setprecision(numeric_limits<long long int>::digits10) << a
           << endl;
    }
  } else if (n == 2) {
    p1 = 6;
    p2 = 4;
    if (m == 1) {
      cout << 4 << endl;
    } else if (m == 2) {
      cout << 6 << endl;
    } else {
      for (int i = 2; i < m; i++) {
        a = p1 + p2 - 2;
        p2 = p1;
        p1 = a;
        a %= 1000000007;
        p1 %= 1000000007;
        p2 %= 1000000007;
      }
      cout << setprecision(numeric_limits<long long int>::digits10) << a
           << endl;
    }
  } else {
    long long int t1 = 4;
    long long int t2 = 2;
    for (int i = 2; i < n; i++) {
      p2 = t1 + t2;
      t2 = t1;
      t1 = p2;
      p2 %= 1000000007;
      t1 %= 1000000007;
      t2 %= 1000000007;
    }
    t1 = 6;
    t2 = 4;
    for (int i = 2; i < n; i++) {
      p1 = t1 + t2 - 2;
      t2 = t1;
      t1 = p1;
      p1 %= 1000000007;
      t1 %= 1000000007;
      t2 %= 1000000007;
    }
    long long int minus = p1 - 4;
    if (m == 1) {
      cout << p2 << endl;
    } else if (m == 2) {
      cout << p1 << endl;
    } else {
      for (int i = 2; i < m; i++) {
        a = p1 + p2 - minus;
        p2 = p1;
        p1 = a;
        a %= 1000000007;
        p1 %= 1000000007;
        p2 %= 1000000007;
      }
      cout << setprecision(numeric_limits<long long int>::digits10) << a
           << endl;
    }
  }
  return 0;
}
