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