#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dp[300000][3][2];
long long f(long long i, long long last, long long ch, long long end) {
  if (i == end) return 1;
  long long &ans = dp[i][last][ch];
  if (ans != -1) return ans;
  if (ch == 0) {
    ans = f(i + 1, 0, (last == 0), end) + f(i + 1, 1, (last == 1), end);
    ans %= mod;
    return ans;
  }
  ans = f(i + 1, (last ^ 1), 0, end);
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  memset(dp, -1, sizeof(dp));
  long long ans2 = f(0, 2, 0, m) - 2;
  memset(dp, -1, sizeof(dp));
  long long ans1 = f(0, 2, 0, n) - 2;
  cout << (ans1 + ans2 + 2) % mod;
}
