#1353 N, L, R = map(int, input().split()) A = list(map(int, input().split())) mod = 998244353 DP = [[[0]*((allsum+1)//(last+1)) for last in range(min(N, allsum+1))] for allsum in range(R)] """ allsum+1 総和 last+1 最後の数 <= 総和 length+1 最後の数の連続数 """ DP1 = [[0 for last in range(min(N, allsum+1))] for allsum in range(R)] DP2 = [0]*R for allsum in range(R): for last in range(min(N, allsum+1)): for length in range((allsum+1)//(last+1)): if allsum == last and length == 0: DP[allsum][last][length] = 1 #print(DP) elif length > 0: if allsum+1 >= 2*last+1: if A[last] >= length+1: DP[allsum][last][length] = DP[allsum-last-1][last][length-1] else: DP[allsum][last][length] = DP2[allsum-last-1] try: DP[allsum][last][length] -= DP1[allsum-last-1][last] except IndexError: pass DP[allsum][last][length] %= mod DP1[allsum][last] += DP[allsum][last][length] DP2[allsum] += DP[allsum][last][length] DP1[allsum][last] %= mod DP2[allsum] %= mod ans = sum(DP2[L-1:R]) print(ans%mod)