class Combi(): def __init__(self, N, mod): self.power = [1 for _ in range(N+1)] self.rev = [1 for _ in range(N+1)] self.mod = mod for i in range(2, N+1): self.power[i] = (self.power[i-1]*i) % self.mod self.rev[N] = pow(self.power[N], self.mod-2, self.mod) for j in range(N, 0, -1): self.rev[j-1] = (self.rev[j]*j) % self.mod def com(self, K, R): if K < R: return 0 else: return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod def pom(self, K, R): if K < R: return 0 else: return (self.power[K])*(self.rev[K-R]) % self.mod def main(): mod = 998244353 N, M, A, B = map(int, input().split()) Com = Combi(3*10**5, mod) ans = 0 for k in range(A, B+1): if k >= A*(N-1): ans += Com.com(k-(A-1)*(N-1)-1, N-2)*(M-k) for i in range(1, N+1): ans *= i ans %= mod print(ans) return if __name__ == "__main__": main()