#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
long long fib(long long n) {
  long long a = 0;
  long long b = 1, w;
  for (int i = 0; i < int(n); i++) {
    w = b % inf;
    b = (a + b) % inf;
    a = w % inf;
  }
  return b;
}
int main() {
  long long n, i, j, m, k, q, c = 0, r = 0;
  cin >> n >> m;
  cout << (2 * (fib(n) + fib(m) - 1)) % inf;
}
