#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const long long int INF = (long long int)1e18;
inline int mul(int a, int b) { return ((long long int)a * b) % mod; }
inline int add(int a, int b) {
  int ans = a + b;
  if (ans >= mod) ans -= mod;
  return ans;
}
int aa = 0;
void foo(int i, int j, int n, int m, vector<vector<int> >& g) {
  if (i == n && j == m - 1) {
    int fg = 1;
    for (int j = 0; j < n && fg; j++) {
      for (int k = 0; k < m; k++) {
        int x = 0;
        if (j - 1 >= 0 && g[j - 1][k] == g[j][k]) x++;
        if (j + 1 < n && g[j + 1][k] == g[j][k]) x++;
        if (k + 1 < m && g[j][k + 1] == g[j][k]) x++;
        if (k - 1 >= 0 && g[j][k - 1] == g[j][k]) x++;
        if (x > 1) {
          fg = 0;
          break;
        }
      }
    }
    if (fg) {
      aa++;
    }
    return;
  }
  if (i == n) return foo(0, j + 1, n, m, g);
  g[i][j] = 0;
  foo(i + 1, j, n, m, g);
  g[i][j] = 1;
  foo(i + 1, j, n, m, g);
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  vector<long long int> f(N, 0);
  f[0] = 1;
  f[1] = 2;
  for (int j = 2; j < N; j++) f[j] = (f[j - 1] + f[j - 2]) % mod;
  int n, m;
  cin >> n >> m;
  if (n > m) swap(n, m);
  if (m < 3 || n < 2) {
    if (n == 1) {
      cout << (f[m - 1] * 2) % mod;
    } else if (n == 2) {
      cout << 6 << endl;
    }
    return 0;
  }
  long long int ans = 1;
  if (m >= 3) {
    ans++;
    for (int j = 0; j <= (m - 4); j++) ans = (ans + f[j]) % mod;
  }
  if (n >= 3) {
    ans++;
    for (int j = 0; j <= (n - 4); j++) ans = (ans + f[j]) % mod;
  }
  if (n >= 3)
    ans = (ans + f[n - 3]) % mod;
  else
    ans++;
  if (m >= 3)
    ans = (ans + f[m - 3]) % mod;
  else
    ans++;
  cout << (ans * 2) % mod << '\n';
  return 0;
}
