#include <bits/stdc++.h>
using namespace std;
int main() {
  long long(n);
  scanf("%lld", &(n));
  ;
  long long(m);
  scanf("%lld", &(m));
  ;
  vector<long long> fib(1 + max(n, m), 0);
  fib[0] = 1;
  for (int i = 1; i <= max(n, m); i++) {
    fib[i] = (fib[i - 1] + (i - 2 >= 0 ? fib[i - 2] : 0)) % 1000000007;
  }
  printf("%lld\n",
         ((2 * (fib[n] + fib[m] - 1)) % 1000000007 + 1000000007) % 1000000007);
  return 0;
}
