#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 2 * 1e5 + 10;
const long long inf = 1e18;
const long long ninf = -1e18;
long long gcd(long long, long long);
long long modPower(long long, long long, long long);
long long power(long long, long long);
long long modInverse(long long, long long);
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long modPower(long long x, long long y, long long m) {
  if (y == 0) return 1;
  long long p = modPower(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long p = power(x, y / 2);
  p = (p * p);
  return (y % 2 == 0) ? p : (x * p);
}
long long modInverse(long long a, long long m) {
  return ((modPower(a, m - 2, m) + mod) % mod);
}
long long modDivide(long long a, long long b, long long m) {
  a = a % m;
  long long inv = modInverse(b, m);
  if (inv == -1)
    return 0;
  else
    return (inv * a) % m;
}
struct comparepq {
  bool operator()(pair<int, int> a, pair<int, int> b) {
    if (a.second == b.second) return a.first > b.first;
    return a.second < b.second;
  }
};
bool myCompare(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first) return a.first < b.first;
  return a.first < b.first;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  if (n < m) swap(n, m);
  long long ans[n + 1];
  ans[1] = 2;
  ans[2] = 4;
  for (int i = (3); i < (n + 1); i++) ans[i] = (ans[i - 1] + ans[i - 2]) % mod;
  long long final = ans[n], cnt = 1;
  if (m == 1) {
    cout << final << "\n";
    return;
  }
  final += 2;
  for (int i = (2); i < (m); i++) final = (final + ans[cnt++]) % mod;
  cout << final % mod << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long t = 1;
  for (int i = (0); i < (t); i++) {
    solve();
  }
  return 0;
}
