#include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair; const ll INF = (1LL << 61); ll mod = 998244353; ll dp[2010][2010]; signed main() { ios::sync_with_stdio(false); cin.tie(0); ll N, L, R; cin >> N >> L >> R; vectorA(N+1); for (int i = 1; i <= N; i++)cin >> A[i]; vectorsum(R + 1); dp[0][0] = 1; sum[0] = 1; for (int i = 1; i <= R; i++) { for (int j = 1; j <= N; j++) { for (int k = 1; k * j <= i && k <= A[j]; k++) { dp[i][j] += sum[i - k * j]; dp[i][j] %= mod; dp[i][j] -= dp[i - k * j][j]; dp[i][j] += mod; dp[i][j] %= mod; sum[i] += sum[i - k * j]; sum[i] %= mod; sum[i] -= dp[i - k * j][j]; sum[i] += mod; sum[i] %= mod; } } } ll ans = 0; for (int i = L; i <= R; i++) { ans += sum[i]; ans %= mod; } cout << ans << endl; return 0; }