#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long memo[112345][3];
long long solve(int x, int rep) {
  if (x == 0) return 1;
  long long& p = memo[x][rep];
  if (p + 1) return p;
  if (rep == 1)
    p = solve(x - 1, 0);
  else if (rep == 0)
    p = solve(x - 1, 0) + solve(x - 1, 1);
  if (p >= MOD) p -= MOD;
  return p;
}
int main() {
  int n, m;
  cin >> n >> m;
  memset(memo, -1, sizeof memo);
  long long ans = 2LL * solve(n - 1, 0);
  ans %= MOD;
  ans += 2LL * solve(m - 1, 0);
  ans %= MOD;
  ans -= 2;
  if (ans < 0) ans += MOD;
  cout << ans << endl;
  return 0;
}
