#include <bits/stdc++.h>
using namespace std;
const long long INF(0x3f3f3f3f3f3f3f3fll);
template <typename T>
void read(T &res) {
  bool flag = false;
  char ch;
  while (!isdigit(ch = getchar())) (ch == '-') && (flag = true);
  for (res = ch - 48; isdigit(ch = getchar());
       res = (res << 1) + (res << 3) + ch - 48)
    ;
  flag && (res = -res);
}
template <typename T>
void Out(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) Out(x / 10);
  putchar(x % 10 + '0');
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long pow_mod(long long x, long long n, long long mod) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}
long long fact_pow(long long n, long long p) {
  long long res = 0;
  while (n) {
    n /= p;
    res += n;
  }
  return res;
}
long long mult_mod(long long a, long long b, long long c) {
  a %= c;
  b %= c;
  long long ret = 0, tmp = a;
  while (b) {
    if (b & 1) {
      ret += tmp;
      if (ret > c) ret -= c;
    }
    tmp <<= 1;
    if (tmp > c) tmp -= c;
    b >>= 1;
  }
  return ret;
}
bool check(long long a, long long n, long long x, long long t) {
  long long v = pow_mod(a, x, n);
  long long s = v;
  for (int i = 1; i <= t; i++) {
    v = mult_mod(v, v, n);
    if (v == 1 && s != 1 && s != n - 1) return true;
    s = v;
  }
  if (v != 1)
    return true;
  else
    return false;
}
bool Miller_Rabin(long long n) {
  if (n < 2) return false;
  if (n == 2) return true;
  if ((n & 1) == 0) return false;
  long long x = n - 1, t = 0;
  while ((x & 1) == 0) {
    x >>= 1;
    t++;
  }
  srand(time(NULL));
  for (int i = 0; i <= 19; i++) {
    long long a = rand() % (n - 1) + 1;
    if (check(a, n, x, t)) return false;
  }
  return true;
}
const int N = 2e5 + 10;
long long a[N], b[N], c[N];
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0);
  long long n, m;
  cin >> n >> m;
  a[1] = 2, a[2] = 4;
  c[1] = 2, c[2] = 4;
  for (int i = 3; i <= n; i++) {
    c[i] = c[i - 1] % 1000000007 + c[i - 2] % 1000000007;
    c[i] %= 1000000007;
  }
  for (int i = 3; i <= m; i++) {
    a[i] = (a[i - 1] % 1000000007 + a[i - 2] % 1000000007) % 1000000007;
  }
  b[1] = a[m], b[2] = a[m] + 2;
  for (int i = 3; i <= n; i++) {
    b[i] = c[i - 1] % 1000000007 + b[i - 2] % 1000000007;
    b[i] %= 1000000007;
  }
  cout << b[n] % 1000000007 << endl;
  return 0;
}
