#include <bits/stdc++.h>
using namespace std;
int fib(int Place) {
  unsigned long OldValue = 1;
  unsigned long Value = 1;
  unsigned long Hold;
  if (Place < 1) {
    return (0);
  }
  for (int n = 1; n < Place; n++) {
    Hold = Value;
    Value += OldValue;
    OldValue = Hold;
  }
  return (Value);
}
int main() {
  long long n, m, k = 1e9 + 7;
  cin >> n >> m;
  unsigned long long a = fib(n) * 2, b = fib(m) * 2, otv = 0;
  if (n == 1) a = 2;
  if (m == 1) b = 2;
  otv = (a + b - 2) % k;
  cout << otv;
}
