#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long ans = 0;
  int mod = 1000000000 + 7;
  vector<long long> a(n);
  a[0] = 1;
  if (n > 1) {
    a[1] = 2;
  }
  for (int i = 2; i < n; i++) {
    a[i] = (a[i - 1] + a[i - 2]);
    a[i] %= mod;
  }
  ans += a[n - 1];
  ans %= mod;
  vector<long long> b(m);
  b[0] = 1;
  if (m > 1) {
    b[1] = 2;
  }
  for (int i = 2; i < m; i++) {
    b[i] = (b[i - 1] + b[i - 2]);
    b[i] %= mod;
  }
  ans += b[m - 1];
  ans--;
  ans %= mod;
  ans *= 2;
  ans %= mod;
  cout << ans << endl;
}
