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