#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (n > m) swap(n, m);
  vector<int> fib(m + 1, 1);
  for (int i = 2; i != m + 1; i++)
    fib[i] = (fib[i - 1] + fib[i - 2]) % (long long)(1e9 + 7);
  cout << (long long)(2 * fib[m] + 2 * fib[n] - 2) % (long long)(1e9 + 7);
  return 0;
}
