#include <bits/stdc++.h>
using namespace std;
long long DIV = 1e9 + 7;
long long t[100000] = {};
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << "2\n";
    return 0;
  }
  if (n < m) {
    int temp = n;
    n = m;
    m = temp;
  }
  t[0] = 1;
  for (int i = 1; i < 100000; i++)
    t[i] = (t[i - 1] + (i > 1 ? t[i - 2] : 1)) % DIV;
  if (m == 1) {
    cout << (t[n - 1] * 2) % DIV << "\n";
    return 0;
  }
  long long meg = t[n - 1] - 1;
  if (meg < 0) meg += DIV;
  meg = (meg * 2) % DIV;
  cout << (meg + (t[m - 1] * 2) % DIV) % DIV << "\n";
  return 0;
}
