#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  int sum = 0;
  int horiz = 0, horizsum = 0;
  int dp1 = 2, dp2 = 4;
  int vert = 0, vertsum = 0;
  if (n == 1)
    horizsum = 2;
  else if (n == 2)
    horizsum = 4;
  else {
    horiz = 3;
    while (horiz <= n) {
      horizsum = dp1 + dp2;
      dp1 = dp2;
      dp2 = horizsum;
      ++horiz;
    }
  }
  dp1 = 2, dp2 = 4;
  if (m == 1)
    vertsum = 2;
  else if (m == 2)
    vertsum = 4;
  else {
    vert = 3;
    while (vert <= m) {
      vertsum = dp1 + dp2;
      dp1 = dp2;
      dp2 = vertsum;
      ++vert;
    }
  }
  sum = (horizsum + vertsum - 2) % 1000000007;
  cout << sum;
  return 0;
}
