#include <bits/stdc++.h>
const long long N = 100010;
using namespace std;
inline long long rnd() {
  long long res = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    res = res * 10 + ch - '0';
    ch = getchar();
  }
  return res * f;
}
inline void wr(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) wr(x / 10);
  putchar(x % 10 + '0');
}
const long long mod = 1e9 + 7;
long long n, m, ans;
long long a[1005][1005];
long long dx[4] = {0, 0, -1, 1};
long long dy[4] = {1, -1, 0, 0};
inline long long nnx(long long x, long long y) {
  if (y == m) {
    return x + 1;
  } else
    return x;
}
long long fac[N];
signed main() {
  cin >> n >> m;
  fac[1] = fac[2] = 1;
  for (long long i = 3; i <= 100000; i++) {
    fac[i] = (fac[i - 1] + fac[i - 2]) % mod;
  }
  ans = 2 * (fac[n + 1] + fac[m + 1] - 1) % mod;
  wr(ans);
  return 0;
}
