#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, res = (1000000000 + 7) - 2;
  cin >> n >> m;
  pair<long long, long long> aux{0, 2};
  for (int i = 0; i <= max(n, m); ++i) {
    if (i == n) {
      res += aux.second;
      res %= (1000000000 + 7);
    }
    if (i == m) {
      res += aux.second;
      res %= (1000000000 + 7);
    }
    aux = {aux.second, (aux.first + aux.second) % (1000000000 + 7)};
  }
  cout << res << endl;
  return 0;
}
