#include <bits/stdc++.h>
using namespace std;
int n, m;
int answer;
int result1, result2;
int numN1(int x) {
  if (x == 1) {
    return 2;
  }
  if (x == 2) {
    return 4;
  }
  int num1 = 2, num2 = 4;
  for (int i = 2; i < x; i++) {
    result1 = num1 + num2;
    num1 = num2 % (1000000000 + 7);
    num2 = result1 % (1000000000 + 7);
  }
  return result1;
}
int numNM(int x) {
  if (x == 1) {
    return 1;
  }
  if (x == 2) {
    return 2;
  }
  int num1 = 1, num2 = 2;
  for (int i = 2; i < x; i++) {
    result2 = num1 + num2;
    num1 = num2 % (1000000000 + 7);
    num2 = result2 % (1000000000 + 7);
  }
  return result2;
}
int main() {
  cin >> n;
  cin >> m;
  if (n < m) {
    n = m - n;
    m = m - n;
    n = n + m;
  }
  answer = numNM(m) * 2 + numN1(n) - 2;
  cout << answer;
  return 0;
}
