#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long INF = 1e18;
const long double PI = 4 * atan((long double)1);
const int INFTY = 1e7;
int grid[100][100];
long long ans;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  if (n > m) swap(n, m);
  vector<long long> dp(m + 5);
  dp[1] = 2;
  dp[2] = 4;
  for (int i = 3; i <= m; ++i) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }
  long long ans = dp[m];
  ans = (ans + 2ll * (n - 1)) % MOD;
  cout << ans << endl;
}
