#include <bits/stdc++.h>
using namespace std;
int main() {
  long long mod = 7 + 1e9;
  long long n, m;
  cin >> n >> m;
  long long a, b, c = b, d = b;
  a = 2;
  b = 4;
  for (int i = 3; i <= m; i++) {
    c = (a + b) % mod;
    a = b;
    b = c;
  }
  if (m == 2) c = 4;
  if (m == 1) c = 2;
  a = 2;
  b = 4;
  for (int j = 3; j <= n; j++) {
    d = (a + b) % mod;
    a = b;
    b = d;
  }
  if (n == 2) d = 4;
  if (n == 1) d = 2;
  long long sum = c % mod + d % mod - 2;
  cout << sum;
}
