#include <bits/stdc++.h>
using namespace std;
long long a[300010];
int s[100][100];
int ans = 0;
int n, m;
void dfs(int x, int y, int v) {
  if (y == m + 1) y = 1, x++;
  s[x][y] = v;
  if (x == n && y == m) {
    int flag = 1;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        int cnt = 0;
        cnt += s[i - 1][j] != 0 && s[i - 1][j] == s[i][j];
        cnt += s[i + 1][j] != 0 && s[i + 1][j] == s[i][j];
        cnt += s[i][j - 1] != 0 && s[i][j - 1] == s[i][j];
        cnt += s[i][j + 1] != 0 && s[i][j + 1] == s[i][j];
        if (cnt > 1) flag = 0;
      }
    }
    if (flag) ans++;
    return;
  }
  dfs(x, y + 1, 1);
  dfs(x, y + 1, 2);
}
int main() {
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  long long mod = 1e9 + 7;
  a[1] = 2;
  a[2] = 4;
  for (int i = 3; i <= m; i++) {
    a[i] = (a[i - 1] + a[i - 2]) % mod;
  }
  cout << (a[m] + 2 * (n - 1)) % mod;
  return 0;
}
