#include <bits/stdc++.h>
using namespace std;
const long long N = 101234, M = 1000 * 1000 * 1000 + 7;
long long dp[N];
long long tav(long long x, long long n) {
  if (n == 0) return 1;
  long long ans = tav(x, n / 2);
  ans = ans * ans;
  ans %= M;
  if (n % 2) {
    ans *= x;
    ans %= M;
  }
  return ans;
}
long long inv(long long x) { return tav(x, M - 2); }
long long fac(long long x) {
  long long ans = 1;
  for (long long i = 1; i <= x; i++) {
    ans *= i;
    ans %= M;
  }
  return ans;
}
long long C(long long k, long long n) {
  return (fac(n) * (inv((fac(n - k) * fac(k)) % M)) % M) % M;
}
long long ans(long long x) {
  if (dp[x] != -1) return dp[x];
  if (x == 0) return 1;
  if (x == 1) return 1;
  if (x == 2) return 2;
  return dp[x] = (ans(x - 1) + ans(x - 2)) % M;
}
int32_t main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < N; i++) dp[i] = -1;
  long long a = 2 * ans(m);
  a %= M;
  a += 2 * ans(n) - 2;
  a %= M;
  cout << a;
}
