#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int MAX = 1e5 + 5;
const int MOD = 1e9 + 7;
const long long INF = INT_MAX;
const long long _INF = INT_MIN;
int n, m;
long long total[MAX];
void precompute(int temp) {
  total[0] = 1;
  total[1] = 1;
  for (int i = 2; i <= temp; i++)
    total[i] = (total[i - 1] + total[i - 2]) % MOD;
}
long long solve() {
  long long curr_2 = (2 * ((total[n] - 1) + MOD)) % MOD;
  long long curr_1 = (2 * total[m]) % MOD;
  return (curr_1 + curr_2) % MOD;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  precompute(max(n, m));
  cout << solve();
}
