#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long mod = 1000000007;
long long Fibonacci[100050];
long long beki(long long a, long long b) {
  if (b == 0) return 1;
  long long ret = beki(a, b / 2);
  ret = ret * ret % mod;
  if (b & 1) ret = ret * a % mod;
  return ret;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, M;
  cin >> N >> M;
  Fibonacci[0] = 1;
  Fibonacci[1] = 1;
  for (long long i = 2; i <= 1e5; i++) {
    Fibonacci[i] = (Fibonacci[i - 2] + Fibonacci[i - 1]) % mod;
  }
  long long change = 2;
  long long rest = 2 * Fibonacci[N] - 2;
  rest %= mod;
  long long ans = 0;
  ans = change * Fibonacci[M];
  ans %= mod;
  ans += rest;
  ans %= mod;
  cout << ans << endl;
  return 0;
}
