#include <bits/stdc++.h>
using namespace std;
long long int f[1000007];
void fib() {
  f[0] = f[1] = 1;
  for (int i = 2; i < 1000007; i++) f[i] = (f[i - 1] + f[i - 2]) % 1000000007;
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  fib();
  cout << (2 * (f[n] + f[m] - 1)) % 1000000007 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
