#include <bits/stdc++.h>
using namespace std;
const long long M = (long long)1e9 + 7;
void tc() {
  long long n, m, l;
  cin >> n >> m;
  l = max(n, m);
  long long f[l + 1];
  f[0] = 2;
  f[1] = 2;
  for (int i = 2; i < l + 1; i++) f[i] = (f[i - 1] + f[i - 2]) % M;
  cout << (f[n] + f[m] - 2) % M;
}
int main() {
  long long t = 1;
  while (t--) tc();
  return 0;
}
