#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const long long INF = 1e18;
const long long M = 1e9 + 7;
long long qpow(long long a, long long p, long long n) {
  long long res = 1;
  for (; p; a = a * a % n, p >>= 1) {
    if (p & 1) {
      res = res * a % n;
    }
  }
  return res;
}
const long long maxn = 2e5;
long long dp[maxn][2];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  dp[1][0] = 2;
  for (long long i = 1; i < m; ++i) {
    dp[i + 1][0] = (dp[i][1] + dp[i][0]) % M;
    dp[i + 1][1] = dp[i][0];
  }
  cout << (dp[m][0] + dp[m][1] + 2 * (n - 1)) % M << endl;
  return 0;
}
