#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  long long n, m;
  cin >> n >> m;
  auto go = [&](long long n) {
    if (n == 1) return 1ll;
    vector<long long> b(n);
    b[n - 1] = 1;
    b[n - 2] = 2;
    for (long long i = n - 3; i >= 0; i--) {
      b[i] = (b[i + 2] + b[i + 1]) % mod;
    }
    return b[0];
  };
  long long A = go(n), B = go(m);
  long long ret = (mod + A + B - 1) % mod;
  ret = (ret * 2) % mod;
  cout << ret << endl;
  return 0;
}
