#include <bits/stdc++.h>
template <std::size_t Base>
std::size_t fib(const std::size_t n) {
  std::size_t first = 1;
  if (n == 1) return first;
  std::size_t second = 2;
  if (n == 2) return second;
  std::size_t result = 0;
  for (std::size_t i = 0; i < n - 2; i++) {
    result = (first + second) % Base;
    first = second % Base;
    second = result % Base;
  }
  return result;
}
int main() {
  std::size_t n, m;
  std::cin >> n >> m;
  static constexpr std::size_t Base = 1e9 + 7;
  std::cout << (2 * (fib<Base>(n) + fib<Base>(m) - 1)) % Base << std::endl;
}
