#include <bits/stdc++.h>
using namespace std;
long long s[1000005] = {0, 2, 4};
int m[1000005];
int ss[1000005];
int main() {
  long long a, b;
  for (int i = 3; i < 1000005; i++) {
    s[i] = s[i - 1] + s[i - 2];
    s[i] = s[i] % 1000000007;
  }
  cin >> a >> b;
  cout << (s[a] + s[b] - 2) % 1000000007 << endl;
  return 0;
}
