local mmi, mma = math.min, math.max local bls, brs = bit.lshift, bit.rshift local bxor = bit.bxor local bor, band = bit.bor, bit.band -- work_func(idx) -- v = [0, 1, 2] local function grayWalk3(size, work_func, box) assert(size <= 15) local prv = 0 local total = 3^size - 1 local rep = 3^(size-1) local bpos = {} for i = 1, size do bpos[bls(1, i - 1)] = i end local v2 = 0 for i = 1, size do box[i] = 0 end local function incOne() if box[1] == 0 then box[1] = 1 v2 = v2 + 1 elseif box[1] == 1 then box[1] = 2 else box[1] = 0 v2 = v2 - 1 end work_func(1) end local function incX() local z = band(v2, -v2) * 2 local p = bpos[z] if box[p] == 0 then box[p] = 1 v2 = v2 + z elseif box[p] == 1 then box[p] = 2 else box[p] = 0 v2 = v2 - z end work_func(p) end work_func(1) incOne() incOne() for i = 1, rep - 1 do incX() incOne() incOne() end end local n, k = io.read("*n", "*n") local a = {} local v = 0 for i = 1, n do a[i] = io.read("*n") v = v - a[i] end local function finish() print("Yes") os.exit() end for i = 1, n do if a[i] == k then finish() end end local large = 10 < n local tail_allplus, tail_allminus = {}, {} local tail = {} local graybox = {} if large then local tn = n - 10 local v = 0 local cnt1 = 0 local cnt2 = 0 local function work_func(idx) if graybox[idx] == 0 then if 0 < cnt2 then cnt2 = cnt2 - 1 v = v - a[10 + idx] end elseif graybox[idx] == 1 then cnt1 = cnt1 + 1 v = v - a[10 + idx] else cnt1 = cnt1 - 1 cnt2 = cnt2 + 1 v = v + 2 * a[10 + idx] end if cnt2 == 0 and 0 < cnt1 then tail_allminus[v] = true elseif cnt1 == 0 and 0 < cnt2 then tail_allplus[v] = true else if 0 < cnt1 and 0 < cnt2 then tail[v] = true end end end grayWalk3(tn, work_func, graybox) end if tail[k] then finish() end do local tn = mmi(10, n) local v = 0 local cnt1 = 0 local cnt2 = 0 local function work_func(idx) if graybox[idx] == 0 then if 0 < cnt2 then cnt2 = cnt2 - 1 v = v - a[idx] end elseif graybox[idx] == 1 then cnt1 = cnt1 + 1 v = v - a[idx] else cnt1 = cnt1 - 1 cnt2 = cnt2 + 1 v = v + 2 * a[idx] end local z = k - v if tail[z] then finish() end if 0 < cnt1 then if tail_allplus == z then finish() end end if 0 < cnt2 then if tail_allminus == z then finish() end end if 0 < cnt1 and 0 < cnt2 then if z == 0 then finish() end end end grayWalk3(tn, work_func, graybox) end print("No")