#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m;
map<long long, long long> a;
long long f(long long x) {
  if (x == 1 || x == 0) return 1;
  if (a.count(x)) return a[x];
  long long q = 0, w = x / 2;
  if (x & 1)
    q = f(w) * (f(w - 1) + f(w + 1)) % mod;
  else
    q = f(w) * f(w) % mod + f(w - 1) * f(w - 1) % mod;
  a[x] = q;
  return q;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  cout << (f(n) * 2 + f(m) * 2 - 2) % mod;
}
