#include <bits/stdc++.h>
using namespace std;
const long long logN = 20;
const long long M = 1000000007;
const long long INF = 1e12;
const long long N = 100005;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long a1 = 2, b1 = 4;
  for (long long i = 3; i < m + 1; i++) {
    long long t = (a1 + b1) % M;
    a1 = b1;
    b1 = t;
  }
  long long a2 = 2, b2 = 4;
  for (long long i = 3; i < n + 1; i++) {
    long long t = (a2 + b2) % M;
    a2 = b2;
    b2 = t;
  }
  if (n == 1 and m == 1) {
    cout << 2 << "\n";
  } else if (n == 1) {
    cout << b1 << "\n";
  } else if (m == 1) {
    cout << b2 << "\n";
  } else {
    cout << ((b1 + b2 - 2) % M + M) % M << "\n";
  }
  return 0;
}
