#include using namespace std; typedef long long ll; ll mod = 998244353,dp[2010][2010] = {},a[2010]; int main(){ ll i,j,k,m,n,l,r; cin >> n >> l >> r; for(i=1;i<=n;i++) cin >> a[i]; for(i=1;i<=n;i++){ for(j=1;j<=a[i];j++){ if(j*i>2000) break; dp[i][j*i] = 1; } } for(j=0;j<=2000;j++){ for(i=1;i<=n;i++){ for(k=1;k<=2000 - j;k++){ if(k==i) continue; for(m=1;m<=a[k];m++){ if(j + m*k>2000) break; (dp[k][j + m*k] += dp[i][j]) %= mod; } } } } ll ans = 0; for(i=1;i<=n;i++){ for(j=l;j<=r;j++) (ans += dp[i][j]) %= mod; } cout << ans << endl; }