#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
const int mod = 1e9 + 7;
int dp[N + 2][2];
int solve(int n) {
  dp[0][0] = 1, dp[0][1] = 1, dp[1][0] = 1, dp[1][1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[i][0] = (dp[i - 1][1] + dp[i - 2][1]) % mod;
    dp[i][1] = (dp[i - 1][0] + dp[i - 2][0]) % mod;
  }
  return (dp[n][0] + dp[n][1]) % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  cout << solve(n) + solve(m) - 2 << endl;
  return 0;
}
