#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  int mx = max(n, m);
  vector<int> f(mx + 1);
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i <= mx; ++i) f[i] = (f[i - 1] + f[i - 2]) % mod;
  cout << 2 * (f[n] + f[m] - 1) % mod << "\n";
  return 0;
}
