#include <bits/stdc++.h>
int main() {
  long long int n, m;
  scanf("%lld %lld", &n, &m);
  long long int p = 1000000007;
  long long int s[2][2], t[2][2];
  int i;
  s[0][0] = 1;
  s[0][1] = 0;
  for (i = 1; i < n; i++) {
    s[1][0] = s[0][0] + s[0][1];
    s[1][1] = s[0][0];
    s[0][0] = s[1][0] % p;
    s[0][1] = s[1][1] % p;
  }
  t[0][0] = 1;
  t[0][1] = 0;
  for (i = 1; i < m; i++) {
    t[1][0] = t[0][0] + t[0][1];
    t[1][1] = t[0][0];
    t[0][0] = t[1][0] % p;
    t[0][1] = t[1][1] % p;
  }
  if (n == 1 && m == 1)
    printf("2\n");
  else
    printf("%lld\n", (s[0][0] + s[0][1] + t[0][0] + t[0][1] - 1) * 2 % p);
  return 0;
}
