#include <bits/stdc++.h>
using namespace std;
const long long MAX = 2000001;
long long n, tmp[MAX], m;
long long mod = 1000000007;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  long long num1 = 1, num2 = 1;
  long long ans = 0;
  for (int i = 0; i < n - 1; i++) {
    long long tmp = (num2 + num1) % mod;
    num1 = num2;
    num2 = tmp;
  }
  ans += num2 * 2;
  ans %= mod;
  num1 = 1, num2 = 1;
  for (int i = 0; i < m - 1; i++) {
    long long tmp = (num2 + num1) % mod;
    num1 = num2;
    num2 = tmp;
  }
  ans += (num2 * 2) % mod;
  ans %= mod;
  cout << ans - 2;
  return 0;
}
