import Data.List
import Data.Maybe
import qualified Data.Set as S
import qualified Data.ByteString.Char8 as B

main = do
 [n,k] <- map read . words <$> getLine
 as <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine
 print (noNeed n k as)

noNeed n k as = length $ filter (\(i,a) -> all (\(m,_) -> m-a >= k) (filter (S.member (i,a) . snd) subsets)) ias
 where
  subsets = filter ((>=k) . fst) $ map (\s -> (sum (map snd s), S.fromDistinctAscList s)) (subsequences ias)
  ias = zip [0..] as