Seven bought some new oranges, each of which has a weight, but Seven's OCD makes her want the sum of the weights to be exactly s. To do this, Seven can perform several "siftings" (or none) Each "screening" consists of the following two steps. 1. Calculate the average of the existing orange weights and round down to the nearest whole number, denoted avg 2. Choose to discard all oranges weighing more than avg or discard all oranges weighing less than or equal to avg
Translated with www.DeepL.com/Translator (free version)
输入格式:
in the first line,input two positive integers n,q In the second line, input n positive integers, and the i-th positive integer represents the weight of the i-th orange a[i] The next q lines represent q queries, one positive integer s per line.
输出格式:
For each query, determine whether the weight of the oranges can be summed to exactly s by "sifting" several times (possibly 0 times). If yes, output YES, otherwise output NO
For the first query, you can perform one filtering operation: avg=4, discard the oranges larger than avg, the remaining oranges are 2 1 exactly and 3, output YES For the second query, we can perform zero filtering operations, and the sum is 7+2+1+6+5=21, output YES For the third query, it is obviously impossible to do so, so output NO 1≤n,q≤100000,1≤a[i]≤1000000000,1≤s≤1000000000