#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int mod = 998244853;
const int INF = 1e9;
long long f[4005];
long long g[4005];
long long mypow(long long a, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = ans * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ans;
}
int main() {
  f[0] = 1;
  for (int i = 1; i <= 4000; i++) f[i] = f[i - 1] * i % mod;
  g[4000] = mypow(f[4000], mod - 2);
  for (int i = 3999; i >= 0; i--) g[i] = g[i + 1] * (i + 1) % mod;
  int n, m;
  scanf("%d%d", &n, &m);
  long long ans = 0;
  for (int i = 0; i < n && i < m; i++)
    ans = (ans + ((f[m + n] * g[i] % mod) * g[m + n - i] % mod)) % mod;
  ans = (ans + (((f[m + n] * g[min(n, m)] % mod) * g[max(n, m)] % mod) *
                (n - min(n, m)) % mod)) %
        mod;
  printf("%lld\n", ans);
  return 0;
}
