#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  if (n < m) {
    n = n + m;
    m = n - m;
    n = n - m;
  }
  vector<long long int> v(max(n, m));
  if (n == 1)
    cout << 2;
  else {
    v[0] = 2;
    v[1] = 4;
    for (int i = 2; i < v.size(); ++i) {
      v[i] = v[i - 1] + v[i - 2];
      v[i] %= 1000000007;
    }
    cout << v[m - 1] + v[n - 1] - 2;
  }
}
