#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int f2, f3;
  for (int i = 2, f0 = 2, f1 = 4; i < n; i++) {
    f2 = (f0 + f1) % 1000000007;
    f0 = f1;
    f1 = f2;
  }
  for (int i = 2, f0 = 2, f1 = 4; i < m; i++) {
    f3 = (f0 + f1) % 1000000007;
    f0 = f1;
    f1 = f3;
  }
  if (n == 1) {
    f2 = 2;
  }
  if (n == 2) {
    f2 = 4;
  }
  if (m == 1) {
    f3 = 2;
  }
  if (m == 2) {
    f3 = 4;
  }
  cout << (1000000007 + f2 + f3 - 2) % 1000000007 << "\n";
  return 0;
}
