#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x = 2, y = 4, z;
  int n, m;
  cin >> n >> m;
  if (m > n) {
    swap(m, n);
  }
  for (int i = 1; i <= m - 2; i++) {
    x = x + y;
    x = x % 1000000007;
    swap(x, y);
  }
  z = y;
  for (int i = m - 1; i <= n - 2; i++) {
    x = x + y;
    x = x % 1000000007;
    swap(x, y);
  }
  long long d = y + z - 2;
  d = d % 1000000007;
  if (m > 1) {
    cout << d;
  } else {
    cout << x;
  }
  return 0;
}
