#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int maxm = 5e5 + 10;
const long long p = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
long long n, m, f[maxn];
int main() {
  cin >> n >> m;
  if (n > m) swap(n, m);
  f[1] = 1;
  f[2] = 2;
  for (int i = 3; i <= m; i++) f[i] = f[i - 1] + f[i - 2];
  long long ans = f[m];
  ans = (ans + n - 1) % p;
  cout << ans * 2 % p << endl;
}
