#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
const int M = 1e9 + 7;
int solve(int n) {
  int b1 = 1, b2 = 0, w1 = 1, w2 = 0;
  for (int i = 1; i < n; ++i) {
    int nb1 = (w1 + w2) % M;
    int nb2 = b1;
    int nw1 = (b1 + b2) % M;
    int nw2 = w1;
    b1 = nb1, w1 = nw1, b2 = nb2, w2 = nw2;
  }
  return (0LL + b1 + b2 + w1 + w2) % M;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int ans = (solve(n) + solve(m) - 2LL + M) % M;
  cout << ans << endl;
}
