#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, x, i;
  cin >> n >> m;
  x = max(n, m) + 1;
  long long dp[x];
  dp[0] = 1;
  dp[1] = 1;
  dp[2] = 2;
  for (i = 3; i < x; i++) dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
  cout << ((2 * dp[n] + 2 * dp[m] - 2) % 1000000007 + 1000000007) % 1000000007;
  return 0;
}
