#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5, M = 1e9 + 7;
int n, m, dp[N][2];
bool solved[N][2];
int calc(int i, int c) {
  if (i == n) {
    return 1;
  }
  if (solved[i][c]) {
    return dp[i][c];
  }
  if (i + 2 <= n) {
    dp[i][c] += calc(i + 2, !c);
  }
  dp[i][c] += calc(i + 1, !c);
  dp[i][c] %= M;
  solved[i][c] = 1;
  return dp[i][c];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  if (n < m) {
    swap(n, m);
  }
  if (n == 1) {
    cout << "2\n";
    return 0;
  } else if (n == 2) {
    if (m == 1) {
      cout << "4\n";
    } else if (m == 2) {
      cout << "6\n";
    }
    return 0;
  }
  int ans = calc(0, 0);
  ans++;
  ans = (ans * 2) % M;
  cout << ans << endl;
}
