#include <bits/stdc++.h>
using namespace std;
long long n;
long long m;
long long g[3005];
long long f[3005];
long long fac[3005 << 1];
long long inv[3005 << 1];
long long quick_pow(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % 998244853;
    x = x * x % 998244853;
    n >>= 1;
  }
  return res;
}
int main() {
  scanf("%lld %lld", &n, &m);
  fac[0] = 1LL;
  for (long long i = 1; i <= n + m; ++i) fac[i] = fac[i - 1] * i % 998244853;
  inv[n + m] = quick_pow(fac[n + m], 998244853 - 2);
  for (long long i = n + m - 1; i >= 0; --i)
    inv[i] = inv[i + 1] * (i + 1) % 998244853;
  for (long long i = 1; i <= n; ++i) {
    long long d = max(abs(2 * i - n + m), abs(0 - n + m));
    long long x = (n + m + d) / 2;
    g[i] = fac[n + m] * inv[x] % 998244853 * inv[n + m - x] % 998244853;
  }
  f[n] = g[n];
  for (long long i = 1; i < n; ++i)
    f[i] = (g[i] - g[i + 1] + 998244853) % 998244853;
  long long ans = 0;
  for (long long i = 1; i <= n; ++i)
    ans = (ans + i * f[i] % 998244853) % 998244853;
  printf("%lld\n", ans);
  return 0;
}
