#include <bits/stdc++.h>
using namespace std;
int a[100100];
long long ww, bb, wb, bw;
long long p = 1000000000 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  a[1] = 1;
  a[2] = 2;
  ww = 1;
  bb = 0;
  bw = 0;
  wb = 1;
  for (int i = 3; i <= max(n, m); i++) {
    long long rez = ww + bb + 2 * wb + 2 * bw;
    long long wb1 = ww + bw;
    long long bb1 = wb;
    long long ww1 = bw;
    long long bw1 = bb + wb;
    wb = wb1 % p;
    bb = bb1 % p;
    ww = ww1 % p;
    bw = bw1 % p;
    a[i] = rez % p;
  }
  cout << 2 * (a[n] + a[m] - 1) % p;
  return 0;
}
