#include <bits/stdc++.h>
static const int M = (int)1e9 + 7;
int64_t mulmod(int64_t a, int64_t b, int64_t mod) {
  return (a * (b % mod)) % mod;
}
int64_t addmod(int64_t a, int64_t b, int64_t mod) {
  return (a % mod + b % mod) % mod;
}
int64_t fib(int64_t n) {
  static std::vector<int64_t> cache = {1, 1};
  if (n + 1 > cache.size()) cache.resize(n + 1, 0);
  for (size_t i = 2; i <= n; ++i) {
    if (!cache[i]) cache[i] = (cache[i - 1] + cache[i - 2]) % M;
  }
  return cache[n];
}
int main() {
  int n, m;
  std::cin >> n >> m;
  int64_t fibs = addmod(fib(m), fib(n), M);
  int64_t res = mulmod(2, addmod(fibs, -1, M), M);
  std::cout << res;
  return 0;
}
