#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n, m;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie();
  cout.tie();
  cin >> n >> m;
  if (n < m) swap(n, m);
  int diff = 2, same = 0, only = 2;
  for (int i = 2; i <= n; i++) {
    int t1 = same, t2 = diff;
    diff = t2 + t1;
    same = t2;
    diff %= MOD;
    same %= MOD;
  }
  int __repeats = (same + diff - 2) % MOD;
  int norepeats = 0, a = 1, b = 1, c = 2;
  if (n <= 1) norepeats = 1;
  if (n == 2) norepeats = 2;
  if (n > 2) {
    for (int i = 3; i < n; i++) a = b, b = c, c = a + b;
    norepeats = 2 * c;
  }
  cout << (__repeats + norepeats) % MOD << '\n';
}
