{-# LANGUAGE OverloadedStrings #-}
import Data.Array.Unboxed
import qualified Data.ByteString.Char8 as B
main = B.getLine >>= main' . breads
    where
        main' [n, d] = B.getLine >>= main'' . array (1, n) . zip [1..n] . build d . breads
        main'' arr = B.getLine >> B.getLine >>= mapM_ (B.putStrLn . toStr . ((arr :: UArray Int Bool) !)) . breads
        toStr b
            | b = "YES"
            | otherwise = "NO"

        breads = check . B.readInt
            where
                check (Just (n, bs))
                    | B.null bs = [n]
                    | otherwise = n : breads (B.tail bs)
                check _ = []

build :: Int -> [Int] -> [Bool]
build d ds = fst $ calc d (tail ds) (0 : ds)
    where
        calc acc (x : xs) (y : ys) = ((next <= acc') : zs, next)
            where
                (zs, b) = calc acc' xs ys
                acc' = min acc . abs $ acc - y
                next
                    | b > x `div` 2 = b + x
                    | otherwise = b
        calc acc _ (y : _) = ([1 <= min acc (abs $ acc - y)], 1)
