#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;
long long dp0[maxn], dp1[maxn];
long long pd0[maxn], pd1[maxn];
void ini(int n) {
  dp1[2] = 1;
  dp0[2] = 1;
  pd0[2] = 1;
  pd1[2] = 1;
  for (int i = 3; i <= n; ++i) {
    dp0[i] = pd0[i - 1] + pd1[i - 1];
    dp0[i] %= mod;
    dp1[i] = dp0[i - 1];
    dp1[i] %= mod;
    pd0[i] = pd1[i - 1];
    pd0[i] %= mod;
    pd1[i] = dp0[i - 1] + dp1[i - 1];
    pd1[i] %= mod;
  }
}
long long get(int k) {
  if (k == 1) return 2;
  return (pd1[k] + pd0[k] + dp1[k] + dp0[k]) % mod;
}
int main() {
  int n, m;
  cin >> n >> m;
  if (n < m) swap(n, m);
  ini(n + 1);
  cout << (get(n) + get(m) - 2 + mod) % mod << endl;
  return 0;
}
