#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  if (m > n) swap(m, n);
  long long int fb[n + 1];
  fb[1] = 1;
  fb[2] = 2;
  for (int i = 3; i <= n; i++) {
    fb[i] = (fb[i - 1] + fb[i - 2]) % mod;
  }
  cout << ((fb[n] + fb[m] - 1) * 2) % mod;
}
