#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long mod(long long x) {
  x %= MOD;
  if (x < 0) return x + MOD;
  return x;
}
vector<long long> fibs;
void calc_fibs(int n) {
  n += 10;
  long long fir = 1;
  long long sec = 1;
  fibs.push_back(fir);
  while (fibs.size() <= n) {
    long long temp = fir + sec;
    fir = sec;
    sec = temp;
    fir %= MOD;
    sec %= MOD;
    fibs.push_back(fir);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  if (n > m) swap(n, m);
  calc_fibs(max(n, m));
  if (n == 1) {
    cout << fibs[m] * 2 % MOD << '\n';
    return 0;
  }
  long long ans = fibs[m] * 2 % MOD;
  ans += fibs[n] % MOD;
  cout << ans % MOD << '\n';
  return 0;
}
