#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long calc(long long n) {
  long long b1 = 1, b2 = 0, w1 = 1, w2 = 0;
  for (int i = 1; i < n; i++) {
    int tb1 = w1 + w2;
    int tb2 = b1;
    int tw1 = b1 + b2;
    int tw2 = w1;
    b1 = tb1 % MOD;
    b2 = tb2 % MOD;
    w1 = tw1 % MOD;
    w2 = tw2 % MOD;
  }
  return (b1 + b2 + w1 + w2) % MOD;
}
int main() {
  long long a, b;
  cin >> a >> b;
  long long res = (calc(a) + calc(b) - 2) % MOD;
  cout << res << endl;
}
