#include <bits/stdc++.h>
using namespace std;
const long long md = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  if (n > m) swap(n, m);
  long long cur = 2;
  for (int i = 2, last = 2; i <= m; ++i) {
    tie(cur, last) = make_pair(cur + last, cur);
  }
  cout << (cur + 2 * (n - 1)) % md << '\n';
}
