#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e5;
unsigned long long dp[inf];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  dp[0] = 1, dp[1] = 2;
  for (int i = 2; i < inf; ++i) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  --n, --m;
  unsigned long long ans = (((dp[n] + dp[m] - 1) % mod) << 1) % mod;
  cout << ans;
}
