#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  cin >> a >> b;
  if (a > b) {
    swap(a, b);
  }
  vector<long long> arr(100005);
  vector<long long> temp(100005);
  arr[0] = 1;
  arr[1] = 2;
  arr[2] = 3;
  temp[1] = 1;
  temp[2] = 1;
  for (long long i = 3; i < b; i++) {
    temp[i] =
        (((arr[i - 1] - temp[i - 1]) % 1000000007) + 1000000007) % 1000000007;
    arr[i] = (((arr[i - 1] + temp[i]) % 1000000007) + 1000000007) % 1000000007;
  }
  cout << (((((arr[a - 1] * 2) % 1000000007) + 1000000007) % 1000000007) +
           (((((arr[b - 1] - 1) * 2) % 1000000007) + 1000000007) %
            1000000007)) %
              1000000007
       << endl;
}
