#include <bits/stdc++.h>
using namespace std;
long long answers[200013];
long long rolling[200013];
int main() {
  if (fopen("FILENAME.in", "r")) {
    freopen("FILENAME.in", "r", stdin);
    freopen("FILENAME.out", "w", stdout);
  }
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  long long answer = 2;
  answers[1] = 2;
  answers[2] = 4;
  answers[3] = 6;
  answers[4] = 10;
  answers[5] = 16;
  answers[6] = 26;
  for (int i = 7; i <= n; i++) {
    answers[i] = answers[i - 1] + answers[i - 2];
    answers[i] %= 1000000007LL;
  }
  answer = answers[n];
  rolling[1] = 2;
  rolling[2] = 2;
  rolling[3] = 4;
  rolling[4] = 6;
  for (int i = 5; i <= m; i++) {
    rolling[i] = rolling[i - 1] + rolling[i - 2];
    rolling[i] %= 1000000007LL;
  }
  for (int i = 1; i < m; i++) {
    answer += rolling[i];
    answer %= 1000000007LL;
  }
  cout << answer << endl;
}
