#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010;
const long long mod = 998244853;
long long sac[MAXN][MAXN];
long long pd(long long i, long long j) {
  if (j > i || i < 0 || j < 0) return 0;
  if (i == 0 && j == 0) return 1;
  if (sac[i][j] != -1) return sac[i][j];
  return sac[i][j] = (pd(i - 1, j) + pd(i, j - 1)) % mod;
}
signed main() {
  memset(sac, -1, sizeof sac);
  long long n, m;
  cin >> n >> m;
  long long res = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < i; j++) {
      if ((n - i) >= m - j) continue;
      long long r = (max(pd(i, j), (long long)1) *
                     max(pd(m - j - 1, n - i), (long long)1)) %
                    mod;
      r *= (i - j), r %= mod;
      res += r, res %= mod;
    }
  }
  if (n > m) res += (pd(n, m) * (n - m)) % mod, res %= mod;
  cout << res << endl;
}
