#include <bits/stdc++.h>
using namespace std;
int n, a, b;
long long c[4000005], inv[4000005], mod = 998244853, ans;
long long fast(long long x, int v) {
  long long an = 1;
  while (v) {
    if (v & 1) an = (an * x) % mod;
    x = (x * x) % mod;
    v >>= 1;
  }
  return an;
}
void pre() {
  c[0] = 1;
  for (int i = 1; i <= n; i++) c[i] = c[i - 1] * i % mod;
  inv[n] = fast(c[n], mod - 2);
  for (int i = n; i >= 1; i--) inv[i - 1] = inv[i] * i % mod;
}
long long C(int n, int m) {
  if (m > n) return 0;
  return c[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  scanf("%d%d", &a, &b);
  n = a + b;
  pre();
  int x = a - b;
  for (int k = max(x, 1); k <= n; k++) {
    if (2 * k - x > n) break;
    int l = 2 * k - x, r = 2 * k + 2 - x;
    long long a1, a2;
    a1 = a2 = 0;
    if ((n - l) % 2)
      a1 = 0;
    else
      a1 = C(n, (n - l) / 2);
    if ((n - r) % 2)
      a2 = 0;
    else
      a2 = C(n, (n - r) / 2);
    ans = (ans + (a1 - a2) * k) % mod;
  }
  ans = (ans % mod) + mod;
  printf("%lld\n", ans % mod);
  return 0;
}
