#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long solve(long long x) {
  long long a = 0, b = 1;
  while (x--) {
    long long t = a + b;
    a = b, b = t % MOD;
  }
  return b;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long n, m;
  cin >> n >> m;
  cout << 2 * (solve(n) + solve(m) - 1) % MOD << '\n';
  return 0;
}
