#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
const int MOD = 1000000007;
const ll INF = 1e18;
const double EPS = 1e-9;
ll fib(int x) {
  ll fi = 1, se = 1;
  for (int i = 1; i < x; ++i) {
    swap(fi, se);
    se = (fi + se) % MOD;
  }
  return se;
}
void solve() {
  int n, m;
  cin >> n >> m;
  cout << (fib(n) + fib(m) - 1) * 2 % MOD << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t_num = 1;
  while (t_num--) {
    solve();
  }
  return 0;
}
