#include <bits/stdc++.h>
using namespace std;
long long int ed, ex, ey;
void extendedEuclid(long long int A, long long int B) {
  if (B == 0) {
    ed = A;
    ex = 1;
    ey = 0;
  } else {
    extendedEuclid(B, A % B);
    long long int temp = ex;
    ex = ey;
    ey = temp - (A / B) * ey;
  }
}
long long int modInverse(long long int A, long long int M) {
  extendedEuclid(A, M);
  return (ex % M + M) % M;
}
long long int todec(long long int b, string s) {
  long long int ans = 0, c = 1, l = s.length();
  reverse(s.begin(), s.end());
  for (long long int i = 0; i < l; i++) {
    if (s[i] <= '9')
      ans += c * (s[i] - '0');
    else
      ans += c * (s[i] - 'A' + 10);
    c = c * b;
  }
  return ans;
}
long long int power(long long int x, long long int y) {
  long long int res = 1;
  x = x % 1000000007;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
long long int arr[100005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  if (m > n) {
    m = m ^ n;
    n = m ^ n;
    m = m ^ n;
  }
  arr[0] = 0;
  arr[1] = 2;
  arr[2] = 4;
  for (long long int i = 3; i <= n; i++)
    arr[i] =
        ((arr[i - 1] % 1000000007) + (arr[i - 2] % 1000000007)) % 1000000007;
  long long int ans =
      (arr[m] % 1000000007 + arr[n] % 1000000007 - 2) % 1000000007;
  cout << ans;
  return 0;
}
