#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010, MOD = 998244853;
int n, m, memo[MAXN][MAXN], ans;
int solve(int i, int j) {
  if (j > i || j < 0 || i < 0) return 0;
  if (i == 0 && j == 0) return 1;
  if (memo[i][j] != -1) return memo[i][j];
  return memo[i][j] = (0ll + solve(i - 1, j) + solve(i, j - 1)) % MOD;
}
int main() {
  memset(memo, -1, sizeof memo);
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < i; j++) {
      if (n - i >= m - j) continue;
      ans += 1ll * (i - j) * max(1, solve(i, j)) % MOD * 1ll *
             max(1, solve(m - j - 1, n - i)) % MOD,
          ans %= MOD;
    }
  if (n > m) ans += 1ll * solve(n, m) * (n - m) % MOD;
  ans %= MOD;
  cout << ans;
}
