#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, P = 1e9 + 7;
int n, m, f[N];
int main() {
  scanf("%d%d", &n, &m);
  f[0] = 2;
  for (int i = 1; i <= m; i++) {
    f[i] = f[i - 1];
    if (i > 1) (f[i] += f[i - 2]) %= P;
  }
  int t = f[m] - 2;
  int s = 1;
  for (int i = 1; i <= n; i++) s = 1ll * s * 2 % P;
  printf("%d\n", (t + s) % P);
  return 0;
}
