#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1e9 + 7;
long long int INF = 1e18;
long long int jj;
long long int modulo(long long int a, long long int b, long long int n) {
  long long int x = 1, y = a;
  y = y % n;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y) % n;
    }
    y = (y * y) % n;
    b /= 2;
  }
  return x % n;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k = 0, l = 0, r = 0, m = 0, n, c, p = 0, cnt = 0,
                      cnt1 = 0, x, y, z = 0, a, b, low, mid, high, ans = 0,
                      maxi = 0, mini = INF, t, x1, y1;
  string s, s1;
  cin >> n >> m;
  a = max(n, m);
  long long int B[a + 1];
  B[0] = 1;
  B[1] = 2;
  B[2] = 4;
  for (i = 3; i <= a; i++) B[i] = (B[i - 1] + B[i - 2]) % MOD;
  cout << (B[n] + B[m] - 2 + MOD) % MOD << endl;
  ;
}
