#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int N = (int)2e6 + 5, mod = 1e9 + 7;
int n, m, f[N];
int main() {
  scanf("%d%d", &n, &m);
  f[0] = 1, f[1] = 2, f[2] = 4;
  for (int i = 3; i <= max(n, m); ++i) f[i] = (f[i - 1] + f[i - 2]) % mod;
  printf("%d\n", (f[n] + f[m] - 2) % mod);
  return 0;
}
