#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e6;
using pll = pair<long long, long long>;
const double delta = 1e-8;
const long long mod = 1e9 + 7;
const int magic_const = 1e9;
const long long INF = 3e18;
const long long BIG_DT = 1e12;
mt19937 gen(54323244234);
long long modoper(long long x) { return ((x % mod) + mod) % mod; }
long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
long long get_rand(long long x) { return (gen() % x + x) % x; }
template <typename T>
void sort(vector<T>& x) {
  sort(x.begin(), x.end());
}
template <typename T>
void reverse(vector<T>& x) {
  reverse(x.begin(), x.end());
}
int count_dt(int x) {
  vector<int> dp(x + 1);
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i <= x; i++) {
    dp[i] += dp[i - 2] + dp[i - 1];
    dp[i] %= mod;
  }
  return dp.back();
}
void solve() {
  long long n, m;
  cin >> n >> m;
  long long at = count_dt(n);
  long long bt = count_dt(m);
  cout << (at + bt - 1) * 2 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(23321);
  solve();
  return 0;
}
