#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, t;
  cin >> n >> m;
  int dp[2][n + 1];
  dp[0][0] = dp[1][0] = 0;
  dp[1][1] = dp[0][1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[0][i] = (dp[0][i - 1] + dp[1][i - 1]) % mod;
    dp[1][i] = dp[0][i - 1] % mod;
  }
  cout << (dp[1][n - 1] + dp[0][n - 1]) * 2 + (m - 1) * 2 << '\n';
  return 0;
}
