#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long i, j, k, n, m;
void read(int &x) {
  char c;
  x = 0;
  int b = 1;
  do {
    c = getchar();
    if (c == 45) b = -1;
  } while (c > 57 || c < 48);
  do x = x * 10 + c - 48, c = getchar();
  while (c <= 57 && c >= 48);
  x *= b;
}
void read(long long &x) {
  char c;
  x = 0;
  int b = 1;
  do {
    c = getchar();
    if (c == 45) b = -1;
  } while (c > 57 || c < 48);
  do x = x * 10 + c - 48, c = getchar();
  while (c <= 57 && c >= 48);
  x *= b;
}
long long dp[100010];
long long check(long long x, long long y) {
  if (dp[y]) return dp[y];
  if (y == 1) return 2;
  if (y == 0) return 1;
  long long ans = check(x, y - 1) + check(x, y - 2);
  if (ans < 0) puts("2");
  return dp[y] = ans % mod;
}
int main() {
  cin >> n >> m;
  if (m < n) swap(n, m);
  cout << (check(n, m - 1) % mod - 1 + n) % mod * 2 % mod << endl;
  return 0;
}
