ave :: (Real a) => [a] -> Double
ave s = (realToFrac $ sum s) / fromIntegral (length s)
f a s= ave s == a
main=do
 [nr,a]<-map read.words<$>getLine
 let nrr = show nr
 let n = read nrr :: Int
 xn<-map read.words<$>getLine
 let xs=[drop p(take q xn)|p<-[0..n],q<-[0..n],p<q]
 print$length$filter (f a) xs
 