#include <bits/stdc++.h>
using namespace std;
long long n, m, t, x;
long long MOD = 1e9 + 7;
long long arr[500005];
int main() {
  cin >> n >> m;
  arr[1] = 1;
  arr[2] = 4;
  arr[3] = 6;
  for (int i = 4; i <= 500005; i++) {
    arr[i] = (arr[i - 1] + arr[i - 2]) % MOD;
  }
  if (n > m) {
    swap(n, m);
  }
  if (n == 1) {
    cout << arr[m] << endl;
    return 0;
  }
  long long val = arr[n];
  for (int i = 1; i < m; i++) {
    val = (val + 2) % MOD;
  }
  cout << val << endl;
  return 0;
}
