#include <bits/stdc++.h>
using namespace std;
namespace mine {
void chmax(int &x, const long long y) { x = (x > y ? x : y); }
void chmin(int &x, const long long y) { x = (x < y ? x : y); }
long long qread() {
  long long ans = 0, f = 1;
  char c = getchar();
  while (c < '0' or c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while ('0' <= c and c <= '9') ans = ans * 10 + c - '0', c = getchar();
  return ans * f;
}
void write(long long num) {
  if (num < 0) putchar('-'), num = -num;
  if (num >= 10) write(num / 10);
  putchar('0' + num % 10);
}
void write1(long long num) {
  write(num);
  putchar(' ');
}
void write2(long long num) {
  write(num);
  putchar('\n');
}
const int INF = 98765421;
const int MOD = 998244853;
void add(long long &a, long long b) {
  a += b;
  a = (a >= MOD ? a - MOD : (a <= -MOD ? a + MOD : a));
}
long long qpower(long long x, long long e) {
  long long ans = 1;
  while (e) {
    if (e & 1) ans = ans * x % MOD;
    x = x * x % MOD;
    e >>= 1;
  }
  return ans;
}
long long invm(long long x) { return qpower(x, MOD - 2); }
const int N = 4e3 + 10;
long long C[N][N];
long long f(int a, int b) {
  if (a > b) return 0;
  return C[a + b][a] - C[a + b][b + 1];
}
long long g(int a, int b) {
  if (a < b or (a == 0 and b == 0)) return 0;
  return C[a + b - 1][a - 1] - C[a + b - 1][a];
}
void main() {
  C[0][0] = 1;
  for (int i = 1; i < N; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
  }
  int n = qread(), m = qread();
  long long ans = 0;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= m; j++)
      ans += g(i, j) * f(n - i, m - j) % MOD * (i - j), ans %= MOD;
  write((ans + MOD) % MOD);
}
};  // namespace mine
int main() {
  srand(time(0));
  mine::main();
}
