#include <bits/stdc++.h>
using namespace std;
long long MODULE = 1000000007;
long long pow2(int y) {
  if (y == 0) return 1;
  long long z = pow2(y / 2);
  if (y % 2 == 0)
    return (z * z) % MODULE;
  else
    return (2 * z * z) % MODULE;
}
long long calcFirstLine(int n) {
  if (n == 1) return 2;
  if (n == 2) return 4;
  long long prevPrev = 2;
  long long prev = 4;
  for (int i = 2; i < n; i++) {
    long long cur = prev + prevPrev % MODULE;
    prevPrev = prev;
    prev = cur;
  }
  return prev;
}
int main() {
  int n, m;
  long long res = 0;
  cin >> n >> m;
  long long one, two;
  if (n >= m) {
    one = calcFirstLine(n);
    two = pow2(m - 1);
    if (m - 1 == 0) two = 0;
    res = one + two;
  } else {
    one = calcFirstLine(m);
    two = pow2(n - 1);
    if (n - 1 == 0) two = 0;
    res = one + two;
  }
  res = res % MODULE;
  cout << res;
  return 0;
}
