#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60777216")
using namespace std;
const int mod = 1000000007;
int f[111111];
int main() {
  f[0] = 1;
  for (int i = (1); i < (111111); i++) {
    f[i] = f[i - 1];
    if (i - 2 >= 0) f[i] += f[i - 2];
    if (f[i] >= mod) f[i] -= mod;
  }
  int n, m;
  cin >> n >> m;
  int res = f[n];
  for (int i = (1); i < (m); i++) res += f[i - 1], res %= mod;
  cout << (res * 2) % mod << endl;
  return 0;
  int a[11][11];
  memset(a, 0, sizeof a);
  for (int n = 1; n <= 10; n++)
    for (int m = 1; m <= n; m++) {
      int x = n * m;
      if (x > 25) continue;
      int num = 0;
      for (int i = (0); i < (1 << x); i++) {
        for (int i1 = (0); i1 < (n); i1++)
          for (int i2 = (0); i2 < (m); i2++) {
            a[i1][i2] = (i & (1 << (i1 * m + i2))) ? 1 : 0;
          }
        bool good = 1;
        for (int i1 = (0); i1 < (n); i1++)
          for (int i2 = (0); i2 < (m); i2++) {
            int w = 0;
            for (int dx = (-1); dx < (2); dx++)
              for (int dy = (-1); dy < (2); dy++)
                if (abs(dx) + abs(dy) == 1) {
                  int nx = i1 + dx;
                  int ny = i2 + dy;
                  if (nx >= 0 && nx < n && ny >= 0 && ny < m)
                    if (a[nx][ny] == a[i1][i2]) w++;
                }
            if (w > 1) good = 0;
          }
        if (good) num++;
      }
      cout << n << ' ' << m << ' ' << num << endl;
    }
  return 0;
}
