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