#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, temp, i;
  cin >> a >> b;
  long long int max_v = max(a, b);
  long long int min_v = min(a, b);
  long long int x = 2, y = 2;
  for (i = 2; i <= max_v; i++) {
    temp = y % 1000000007;
    y = (x + y) % 1000000007;
    x = temp;
  }
  long long int p = 2, q = 2;
  for (i = 2; i <= min_v; i++) {
    temp = q % 1000000007;
    q = (p + q) % 1000000007;
    p = temp % 1000000007;
  }
  cout << (y + q - 2) % 1000000007;
}
