#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long res = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    res = (res << 3) + (res << 1) + ch - '0';
    ch = getchar();
  }
  return res * f;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 | '0');
}
const long long N = 100007;
long long f[N], g[N];
const long long mod = 1e9 + 7;
signed main() {
  long long n = read(), m = read();
  f[1] = 2;
  f[2] = 4;
  for (long long i = 3; i <= max(n, m); i++) f[i] = (f[i - 1] + f[i - 2]) % mod;
  g[1] = f[n], g[2] = g[1] + 2;
  for (long long i = 3; i <= m; i++) g[i] = (g[i - 1] + f[i - 2]) % mod;
  cout << g[m] << endl;
}
