#include <bits/stdc++.h>
using namespace std;
long long d[100005][3], f[100005][3];
long long mod = 1000000007;
int main() {
  long long n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << "2" << endl;
    return 0;
  }
  long long op = min(n, m);
  n = max(n, m);
  d[1][1] = 1;
  d[1][2] = 1;
  d[2][1] = 2;
  d[2][2] = 2;
  for (int i = 3; i <= n; i++) {
    d[i][1] = (d[i - 1][2] + d[i - 2][2]) % mod;
    d[i][2] = (d[i - 1][1] + d[i - 2][1]) % mod;
  }
  long long ans;
  if (op == 1) {
    ans = (d[n][1] + d[n][2]) % mod;
  } else {
    ans = (d[n][1] + d[n][2] + 2 * (op - 1)) % mod;
  }
  cout << ans << endl;
  return 0;
}
