#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int s = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) s = s * 10 + ch - '0', ch = getchar();
  return s * f;
}
const int N = 2005, mod = 998244853;
long long f[N][N], g[N][N];
int n, m;
inline long long qpow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1, a = a * a % mod)
    if (b & 1) res = res * a % mod;
  return res;
}
int main() {
  n = read(), m = read();
  f[1][0] = 1;
  g[0][0] = 1;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= m; j++) {
      if (i == 0 && j == 0) continue;
      if (i > j) {
        if (i != n) (f[i + 1][j] += f[i][j]) %= mod;
        if (j != m) (f[i][j + 1] += f[i][j]) %= mod;
      } else {
        if (i) (g[i][j] += g[i - 1][j]) %= mod;
        if (j) (g[i][j] += g[i][j - 1]) %= mod;
      }
    }
  long long ans = 0;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= m; j++) {
      (ans += (long long)(max(i - j, 0)) * f[i][j] % mod * g[n - i][m - j] %
              mod) %= mod;
    }
  cout << (ans + mod) % mod;
  return 0;
}
