#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1000000000000000000;
const long double pi = 3.14159265358979323846264338;
const long long mod = 1000000007;
long long int pow(long long int x, unsigned long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int invmod(long long int a, long long int m) {
  return pow(a, m - 2, m);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int k = max(n, m);
  long long int dp[k + 1][2];
  dp[0][0] = dp[0][1] = 0;
  dp[1][0] = dp[1][1] = 1;
  for (long long int i = 2; i <= k; i++) {
    dp[i][0] = dp[i - 1][0] + dp[i - 2][1];
    dp[i][1] = dp[i - 1][1] + dp[i - 2][0];
    dp[i][0] %= mod;
    dp[i][1] %= mod;
  }
  long long int ans = 0;
  if (n != m)
    ans = (dp[n][0] + dp[n][1]) * (dp[m][0] + dp[m][1]);
  else
    ans = dp[n][0] + dp[n][1];
  ans %= mod;
  cout << ans << "\n";
}
