#include <bits/stdc++.h>
using namespace std;
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
  uniform_int_distribution<int> uid(0, lim - 1);
  return uid(rang);
}
int X[8] = {0, 0, 1, -1, 1, 1, -1, -1};
int Y[8] = {1, -1, 0, 0, 1, -1, 1, -1};
const long long mod = 1000000007;
const int N = 2e5 + 1, M = N, MAXN = 1005;
long long calc(long long n) {
  long long a = 4, b = 2;
  for (int i = 2; i <= n; i++) {
    long long t = a;
    a = (a + b) % mod;
    b = t;
  }
  return b;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  cout << (calc(n) + calc(m) - 2) % mod << endl;
}
int main() {
  int t = 1;
  while (t--) solve();
}
