#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const vector<int> mods = {998244353, 1000000007, 1000000009};
const long long inf = 3e18;
const double pi = acos(-1.0);
const double eps = 0.0000001;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout.precision(13);
  long long n, m;
  cin >> n >> m;
  long long res = 0;
  vector<long long> cln, dir;
  cln.push_back(2);
  dir.push_back(0);
  for (long long i = (0); i < (n); ++i) {
    cln.push_back((dir[i] + cln[i]) % mod);
    dir.push_back((i > 0 ? cln[i - 1] + dir[i - 1] : 0) % mod);
  }
  res = (res + cln[n] + dir[n]) % mod;
  cln.clear();
  dir.clear();
  cln.push_back(2);
  dir.push_back(0);
  for (long long i = (0); i < (m); ++i) {
    cln.push_back((dir[i] + cln[i]) % mod);
    dir.push_back((i > 0 ? cln[i - 1] + dir[i - 1] : 0) % mod);
  }
  res = (res + cln[m] + dir[m] - 2 + mod) % mod;
  cout << res;
  return 0;
}
