#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  if (n < m) swap(n, m);
  long long dp[n + 1][2][2];
  dp[0][0][1] = dp[0][1][1] = 0;
  dp[0][0][0] = dp[0][1][0] = 1;
  for (int i = 0; i < n; i++) {
    dp[i + 1][0][0] = dp[i][0][1] % 1000000007;
    dp[i + 1][0][1] = (dp[i][1][0] + dp[i][1][1]) % 1000000007;
    dp[i + 1][1][0] = dp[i][1][1] % 1000000007;
    dp[i + 1][1][1] = (dp[i][0][0] + dp[i][0][1]) % 1000000007;
  }
  long long ans = 0;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) ans += dp[n][i][j], ans = ans % 1000000007;
  vector<long long> fib(m + 1, 0);
  fib[1] = fib[2] = 2;
  for (int i = 3; i <= m; i++)
    fib[i] = fib[i - 1] + fib[i - 2], fib[i] = fib[i] % 1000000007;
  for (int i = 0; i < m; i++) ans += fib[i], ans = ans % 1000000007;
  cout << ans << endl;
}
