#include <bits/stdc++.h>
using namespace std;
const long long md = 1e9 + 7;
long long movesx[8] = {-1, 0, 1};
long long movesy[8] = {-1, 0, 1};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
long long power(long long base, long long exponent, long long mod) {
  if (exponent == 0) return 1;
  long long temp = power(base, exponent / 2, mod);
  temp = (temp * temp) % mod;
  if (exponent % 2 != 0) {
    temp = (temp * base) % mod;
    return temp;
  }
  return temp;
}
long long n, a, b, m, ans;
long long w[1000005], h[1000005];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  {
    cin >> n >> m;
    cout << (2 * (n + m - 1)) % md << endl;
  }
  return 0;
}
