#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
const int MOD = 1000 * 1000 * 1000 + 7;
int d[N];
int main() {
  int n, m;
  cin >> n >> m;
  d[2] = 1;
  d[3] = 2;
  for (int i = 4; i <= max(n, m); i++) d[i] = (d[i - 1] + d[i - 2]) % MOD;
  cout << ((d[n] + d[m] + 1) * 2) % MOD << endl;
}
