import numpy as np
n, s = map(int, input().split())
a_list = list(map(int, input().split()))
a_list = np.asarray(a_list)
sum_list = np.copy(a_list)
prev_check = (np.zeros(len(a_list)+1)).astype(int)
ans = 0
for i in range(len(a_list)):
    current_check = (sum_list==s).astype(int)
    # print("더해진 라인 : ")
    # print(sum_list)
    # print("이번 라인에 새로 들어온거 : ")
    # print(current_check)
    # print("지난 라인 : ")
    # print(prev_check)
    current_check += prev_check[:-1] + prev_check[1:]
    prev_check = current_check
    sum_list = sum_list[:-1] + a_list[i+1:]
    # print("합해진 라인 : ")
    # print(current_check)
    ans += np.sum(current_check)
print(ans%998244353)