#include <bits/stdc++.h>
long long a[100010];
int main() {
  long n, m, i;
  scanf("%ld%ld", &n, &m);
  a[0] = 1;
  a[1] = 2;
  a[2] = 4;
  for (i = 3; i <= (((n) > (m)) ? (n) : (m)); i++)
    a[i] = (a[i - 2] + a[i - 1]) % (long)(1e9 + 7);
  if (n >= 2 && m >= 2)
    printf("%lld\n", 2 * a[n - 2] * a[m - 2] % (long)(1e9 + 7) +
                         4 * ((a[n - 2] <= 2) ? 1 : a[a[n - 2]] / 2) *
                             ((a[m - 2] <= 2) ? 1 : a[a[m - 2]] / 2) %
                             (long)(1e9 + 7));
  else
    printf("%lld\n", (m == 2) ? a[m] : a[n]);
  return 0;
}
