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