#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long int> v(max(m + 1, max(3, n + 1)), 0);
  v.at(1) = 2;
  v.at(2) = 4;
  for (int i = 3; i <= max(m, n); i++) {
    v.at(i) = v.at(i - 1) + v.at(i - 2);
    v.at(i) %= 1000000007;
  }
  cout << setprecision(numeric_limits<long long int>::digits10)
       << (v.at(m) + v.at(n) - 2) % 1000000007 << endl;
  return 0;
}
