#include <bits/stdc++.h>
int N, S;
int A[3000];
long long f(int s, int e) {
  long long ret = 0;
  int counter_max = pow(2, e - s + 1) - 1;
  for (int i = 1; i <= counter_max; i++) {
    int idx = s;
    int tmp = i;
    int sum = 0;
    while (tmp > 0) {
      if (tmp & 1) sum += A[idx];
      idx++;
      tmp /= 2;
    }
    if (sum == S) ret++;
  }
  return ret;
}
int main() {
  scanf("%d %d", &N, &S);
  for (int i = 0; i <= N - 1; i++) {
    scanf("%d", &A[i]);
  }
  long long ans;
  for (int i = 0; i <= N - 1; i++) {
    for (int j = i; j <= N - 1; j++) {
      ans += f(i, j);
      ans %= 998244353;
    }
  }
  printf("%ld", ans);
  return 0;
}
