#include <bits/stdc++.h>
const int maxn = 1e6 + 3;
const long long mo = 1e9 + 7;
int n, m;
long long f[maxn];
int main() {
  f[0] = f[1] = 1;
  for (int i = 2; i < maxn; ++i) f[i] = (f[i - 1] + f[i - 2]) % mo;
  scanf("%d%d", &n, &m);
  printf("%lld\n", (2ll * (f[n] + f[m] - 1ll + mo)) % mo);
  return 0;
}
