#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long mod = 1e9 + 7;
int n, m;
long long ans[N], ans1[N];
int main() {
  ans[1] = 2, ans[2] = 4;
  for (int i = 3; i <= 100000; i++) ans[i] = (ans[i - 1] + ans[i - 2]) % mod;
  while (~scanf("%d%d", &n, &m)) {
    if (n > m) swap(n, m);
    if (n == 1) {
      ans[1] = 2, ans[2] = 4;
      for (int i = 3; i <= m; i++) ans[i] = (ans[i - 1] + ans[i - 2]) % mod;
    } else if (n == 2) {
      ans[1] = 4, ans[2] = 6;
      for (int i = 3; i <= 100000; i++)
        ans[i] = (ans[i - 1] + ans[i - 2] - 2) % mod;
    } else
      ans[m] = 0;
    printf("%lld\n", ans[m]);
  }
  return 0;
}
