#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int f(int n) {
  vector<vector<int>> d(n, vector<int>(2, 0));
  d[0][0] = d[0][1] = 1;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < (int)(2); ++j) {
      d[i][j] += d[i - 1][1 - j];
      d[i][j] %= mod;
      if (i > 1) {
        d[i][j] += d[i - 2][1 - j];
        d[i][j] %= mod;
      } else {
        d[i][j] += 1;
        d[i][j] %= mod;
      }
    }
  }
  return (d[n - 1][0] + d[n - 1][1]) % mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  cout << ((f(n) + f(m)) % mod - 2 + mod) % mod << endl;
}
