#include <bits/stdc++.h>
using namespace std;
long long n, m, ans = 0;
void solve(vector<long long> a[], long long i, long long j) {
  if (i == n) {
    bool ok = 1;
    for (long long x = 0; x < n; x++) {
      for (long long y = 0; y < m; y++) {
        long long z = 0;
        if (x - 1 >= 0 && a[x - 1][y] == a[x][y]) z++;
        if (x + 1 < n && a[x + 1][y] == a[x][y]) z++;
        if (y - 1 >= 0 && a[x][y - 1] == a[x][y]) z++;
        if (y + 1 < m && a[x][y + 1] == a[x][y]) z++;
        if (z >= 2) ok = 0;
      }
    }
    if (ok) {
      ans++;
    }
    return;
  }
  long long ii, jj;
  jj = j + 1;
  ii = i;
  if (jj == m) {
    jj = 0;
    ii++;
  }
  a[i][j] = 0;
  solve(a, ii, jj);
  a[i][j] = 1;
  solve(a, ii, jj);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, x;
  cin >> n >> m;
  long long f[100005];
  f[0] = 0;
  f[1] = 2;
  f[2] = 4;
  for (i = 3; i < 100005; i++) f[i] = (f[i - 1] + f[i - 2]) % 1000000007;
  cout << (f[n] + f[m] - 2 + 1000000007) % 1000000007;
}
