#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2005;
const long long MOD = 998244853;
const long long INF = (long long)1e9 + 5;
long long mod_inv(long long a) {
  long long pw = MOD - 2, res = 1;
  while (pw) {
    if (pw & 1) res = res * a % MOD;
    pw >>= 1;
    a = a * a % MOD;
  }
  return res;
}
int N, M;
long long fac[2 * MAXN], finv[2 * MAXN], dp[MAXN][MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fac[0] = finv[0] = 1;
  for (int i = 1; i < 2 * MAXN; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    finv[i] = mod_inv(fac[i]);
  }
  cin >> N >> M;
  for (int i = 0; i <= N; i++) {
    for (int j = 0; j <= M; j++) {
      if (i == 0 && j == 0) {
        dp[i][j] = 1;
      } else {
        if (i > j) {
          if (i > 0) dp[i][j] += dp[i - 1][j];
          if (j > 0) dp[i][j] += dp[i][j - 1];
          dp[i][j] %= MOD;
        }
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= N; i++) {
    for (int j = i; j <= N + M; j++) {
      if ((j - i) % 2 == 0) {
        long long cnt1 = i + (j - i) / 2, cnt2 = j - cnt1;
        long long r1 = N - cnt1, r2 = M - cnt2;
        if (cnt1 > N || cnt2 > M) continue;
        ans = (ans + dp[cnt1][cnt2] * fac[r1 + r2] % MOD * finv[r1] % MOD *
                         finv[r2]) %
              MOD;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
