#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long f[1000001];
  f[1] = 2, f[2] = 4;
  for (int i = 3; i <= 1000000; i++) {
    f[i] = (f[i - 1] + f[i - 2]) % 1000000007;
  }
  cout << (f[n] + f[m] - 2 + 1000000007) % 1000000007;
}
