#include <bits/stdc++.h>
using namespace std;
inline int read() {
  register int res = 0, c;
  while (c = getchar(), c < '0' || c > '9')
    ;
  do {
    res = (res * 10) + (c ^ 48);
  } while (c = getchar(), c >= '0' && c <= '9');
  return res;
}
int s[100010];
int f[100010][4];
const int mod = 1e9 + 7;
int mypow(int k, int n) {
  int ret = 1;
  while (k) {
    if (k & 1) ret = 1ll * ret * n % mod;
    n = 1ll * n * n % mod;
    k >>= 1;
  }
  return ret;
}
int main() {
  int N = read(), M = read();
  f[1][1] = 1;
  for (int i = 2; i <= N || i <= M; i++) {
    f[i][0] = f[i - 1][2];
    f[i][1] = (f[i - 1][0] + f[i - 1][2]) % mod;
    f[i][2] = (f[i - 1][1] + f[i - 1][3]) % mod;
    f[i][3] = f[i - 1][1];
  }
  int fN = 0;
  int fM = 0;
  for (int j = 0; j < 4; j++) fN = (fN + f[N][j]) % mod;
  fN = (fN + fN) % mod;
  for (int j = 0; j < 4; j++) fM = (fM + f[M][j]) % mod;
  fM = (fM + fM) % mod;
  int ans = (fN + fM - 2) % mod;
  if (ans < 0) ans = ans + mod;
  printf("%d\n", ans);
  return 0;
}
