#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  int s = 0, c = getchar();
  x = 0;
  while (isspace(c)) c = getchar();
  if (c == 45) s = 1, c = getchar();
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (s) x = -x;
}
template <typename T>
void write(T x, char c = ' ') {
  int b[40], l = 0;
  if (x < 0) putchar(45), x = -x;
  while (x > 0) b[l++] = x % 10, x /= 10;
  if (!l) putchar(48);
  while (l) putchar(b[--l] | 48);
  putchar(c);
}
const long long mo = 1e9 + 7;
int main(void) {
  int n, m;
  read(n);
  read(m);
  long long f[max(n, m) + 1];
  f[1] = 1;
  f[2] = 2;
  for (int i = 3; i <= max(n, m); ++i) f[i] = (f[i - 1] + f[i - 2]) % mo;
  long long ans = (2 * (f[n] + f[m] - 1) + mo) % mo;
  write(ans, '\n');
  return 0;
}
