#include <bits/stdc++.h>
using namespace std;
long long f[100010][4];
long long n, m, t;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return f * x;
}
inline void solve() {
  f[1][0] = f[1][1] = 1;
  f[2][0] = f[2][1] = f[2][2] = f[2][3] = 1;
  for (register long long i = 3; i <= t; ++i) {
    f[i][0] = f[i - 1][2] % 1000000007;
    f[i][3] = f[i - 1][1] % 1000000007;
    f[i][2] = (f[i - 1][3] + f[i - 1][1]) % 1000000007;
    f[i][1] = (f[i - 1][2] + f[i - 1][0]) % 1000000007;
  }
}
signed main() {
  n = read(), m = read();
  t = max(n, m);
  solve();
  long long ans1 =
      ((f[n][1] + f[n][2]) % 1000000007 + f[n][3] % 1000000007 + f[n][0]) %
      1000000007;
  long long ans2 =
      ((f[m][1] + f[m][2]) % 1000000007 + f[m][3] % 1000000007 + f[m][0]) %
      1000000007;
  if (n == 1) ans1 = 2;
  if (m == 1) ans2 = 2;
  cout << (ans1 + ans2 - 2 + 1000000007) % 1000000007;
  return 0;
}
