#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int mod = 1000000007;
int f[maxn][2][2];
void pd(int& ret, int val) {
  ret += val;
  if (ret >= mod) ret -= mod;
}
int main() {
  int n, m;
  cin >> n >> m;
  int tn = max(n, m);
  if (n > m) swap(n, m);
  if (m == 1) {
    cout << 2 << endl;
    return 0;
  }
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) f[2][i][j] = 1;
  for (int i = 2; i < tn; i++) {
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++) {
        for (int r = 0; r < 2; r++) {
          if (j == k && j == r) continue;
          pd(f[i + 1][k][r], f[i][j][k]);
        }
      }
  }
  int ret = 0;
  if (n == 1)
    pd(ret, 2);
  else {
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) pd(ret, f[n][i][j]);
  }
  pd(ret, mod - 2);
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) pd(ret, f[m][i][j]);
  cout << ret << endl;
  return 0;
}
