#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 1e5 + 5;
long long mod_exp(long long cur, long long power) {
  long long res = 1;
  while (power > 0) {
    if (power % 2 == 0) {
      cur = (cur * cur) % 1000000007;
    } else {
      res = (res * cur) % 1000000007;
      cur = (cur * cur) % 1000000007;
    }
    power /= 2;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  int i, j, n, m;
  cin >> n >> m;
  long long dp1[N], dp0[N];
  dp1[0] = dp0[0] = 1;
  dp1[1] = dp0[1] = 2;
  for (i = 2; i < N; i++) {
    dp1[i] = (dp0[i - 1] + dp0[i - 2]) % 1000000007;
    dp0[i] = (dp1[i - 1] + dp1[i - 2]) % 1000000007;
  }
  long long foo = (dp1[m - 1] + dp0[m - 1]) % 1000000007;
  foo = (foo - 2 + 1000000007) % 1000000007;
  foo = (foo + dp0[n - 1] + dp1[n - 1]) % 1000000007;
  cout << foo << endl;
  return 0;
}
