#include <bits/stdc++.h>
using namespace std;
long long a[100009];
int main() {
  long long i, n, t, k, j, x = 0, y = 0, m;
  a[1] = 2;
  a[2] = 4;
  for (i = 3; i <= 100000; i++) a[i] = (a[i - 1] + a[i - 2]) % 1000000007;
  scanf("%I64d %I64d", &n, &m);
  if (n == 1 || m == 1) {
    printf("%I64d\n", a[max(n, m)]);
    return 0;
  } else {
    printf("%I64d\n", (a[n] + a[m] - 2) % 1000000007);
  }
  return 0;
}
