f :: (Real a) => a -> [a] -> Bool
f a s= (realToFrac $ sum s) / fromIntegral (length s) == a
main=do
 [n,a]<-map read.words<$>getLine
 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
 