#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, m;
  cin >> n >> m;
  long long int dp[max(n, m) + 1];
  dp[0] = dp[1] = 1;
  for (int i = 2; i <= max(m, n); i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % (int)(1e9 + 7);
  }
  cout << (2 * ((dp[n] + dp[m] - 1) % (int)(1e9 + 7))) % (int)(1e9 + 7);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int tests = 1;
  for (long long int test_case = 1; test_case <= tests; test_case++) {
    solve();
  }
  cerr << "Execution Time : " << (float)clock() / CLOCKS_PER_SEC << " secs"
       << endl;
  return 0;
}
