#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/STACK:256000000")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("section-anchors")
#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
#pragma GCC optimize("vpt")
#pragma GCC optimize("rename-registers")
#pragma GCC optimize("move-loop-invariants")
#pragma GCC optimize("unswitch-loops")
#pragma GCC optimize("function-sections")
#pragma GCC optimize("data-sections")
#pragma GCC optimize("branch-target-load-optimize")
#pragma GCC optimize("branch-target-load-optimize2")
#pragma GCC optimize("btr-bb-exclusive")
using namespace std;
const long double pi = 3.1415926;
const int MOD1 = (int)(1e9) + 7;
const int MOD2 = 23456;
const int INF = (int)(1e9) + 1;
const long long LINF = (long long)(1e18) + 1e6;
const int MAXN = (int)(1e5) + 13;
const int MAXQ = (int)(1e5);
struct F {
  struct matrix {
    int n, m;
    vector<vector<long long> > mx;
    matrix(int n, int m) : n(n), m(m), mx(n, vector<long long>(m)) {}
    matrix(vector<vector<long long> > a)
        : n((int)a.size()), m((int)a[0].size()), mx(a) {}
    matrix operator*(const matrix &b) {
      matrix ans(n, b.m);
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < b.m; ++j) {
          for (int k = 0; k < m; ++k) {
            ans.mx[i][j] += mx[i][k] * b.mx[k][j];
            ans.mx[i][j] %= MOD1;
          }
        }
      }
      return ans;
    }
  };
  matrix f1;
  matrix bp(matrix a, int n) {
    if (n == 1) {
      return a;
    }
    if (n % 2 == 0) {
      matrix tmp = bp(a, n / 2);
      return tmp * tmp;
    } else {
      return a * bp(a, n - 1);
    }
  }
  F() : f1({{1, 1}, {1, 0}}) {}
  long long getN(int n) {
    matrix fn = bp(f1, n);
    return fn.mx[0][0];
  }
};
void solve() {
  int n, m;
  cin >> n >> m;
  long long n1 = F().getN(n);
  long long m1 = F().getN(m);
  cout << (2 * (n1 + m1 - 1)) % MOD1;
}
void isolve() {}
void generator() {}
void validator() {}
void stress() {}
signed main() {
  ios_base::sync_with_stdio(false);
  srand((unsigned int)time(nullptr));
  cout.setf(ios::fixed);
  cout.precision(9);
  cout.tie(nullptr);
  cin.tie(nullptr);
  int T = 1;
  while (T--) {
    solve();
  }
}
