#include <bits/stdc++.h>
using namespace std;
int fib_n(long long int n) {
  if (n <= 2) return 1;
  std::vector<long long int> dp(n + 1);
  dp[1] = 1;
  dp[2] = 1;
  for (long long int i = 3; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] = dp[i] % (1000 * 1000 * 1000 + 7);
  }
  return dp[n];
}
int fib_NNNNNNNNNNNNN(long long int n) {
  if (n <= 2) return 1;
  std::vector<long long int> dp(n + 1);
  dp[1] = 1;
  dp[2] = 1;
  for (long long int i = 3; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] = dp[i] % (1000 * 1000 * 1000 + 7);
  }
  return dp[n];
}
int main() {
  int n, m;
  cin >> n >> m;
  long long int cycle = 1000 * 1000 * 1000 + 7;
  cout << (2 * fib_n(n + 1) + 2 * fib_n(m + 1) - 2) % cycle;
}
