#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
inline string inttos(long long int a) {
  std::stringstream soso;
  soso << a;
  return soso.str();
}
inline long long int stoint(const std::string& s) {
  std::stringstream soso;
  soso << s;
  long long x;
  soso >> x;
  return x;
}
inline std::string inttobin(long long int x) {
  return std::bitset<7>(x).to_string();
}
inline void swp(long long int& a, long long int& b) {
  auto temp = a;
  a = b;
  b = temp;
}
long long int modexpo(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return modexpo((x * x) % (long long int)(1e9 + (long long int)7), n / 2);
  else
    return (x * modexpo((x * x) % (long long int)(1e9 + (long long int)7),
                        (n - 1) / 2)) %
           (long long int)(1e9 + (long long int)7);
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  long long int x = max(n, m);
  long long int dp[x + 1];
  dp[0] = 1, dp[1] = 2;
  for (long long int i = 2; i < x + 1; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % (long long int)(1e9 + (long long int)7);
  }
  long long int a = (dp[n - 1] * 2 + dp[m - 1] * 2 +
                     (long long int)(1e9 + (long long int)7) - 2) %
                    (long long int)(1e9 + (long long int)7);
  cout << a << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  for (long long int i = 0; i < t; i++) {
    solve();
  }
}
