#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, unsigned long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x;
    }
    y = y >> 1;
    x = x * x;
  }
  return res;
}
long long int powermod(long long int x, unsigned long long int y,
                       long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % p;
    }
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int32_t main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> f(m + n);
  f[0] = 1, f[1] = 1;
  for (long long int i = (long long int)(2); i < (long long int)(m + n); i++) {
    f[i] = f[i - 1] + f[i - 2];
    f[i] %= 1000000007;
  }
  long long int ans = 2 * f[n];
  ans %= 1000000007;
  ans += 2 * f[m];
  ans %= 1000000007;
  ans -= 2;
  if (ans < 0) ans += 1000000007;
  cout << ans << "\n";
  return 0;
}
