#include <bits/stdc++.h>
using namespace std;
const int MOD = 2e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  if (n < m) swap(n, m);
  vector<long long> f(n);
  f[0] = 1;
  f[1] = 2;
  for (int i = 2; i < n; i++) f[i] = (f[i - 1] + f[i - 2]) % MOD;
  cout << ((f[n - 1] + f[m - 1] - 1 + MOD) % MOD) * 2 % MOD << endl;
  ;
}
