It’s universally acknowledged that there’re innumerable trees in the campus of HUST.
One day you find an endless forest consisting of magic trees. The forest can be described in such a strange way: initially you know N trees with the magic power a1,…,an. Then for every (i,j) (i can be equal to j) one tree with the magic power ai-aj and one tree with the magic power ai+aj will appear in the forest, then you know there will be 3N trees with the magic power . This process can be done repeatedly, so you know that the infinite forest contains innumerable trees. What you want to know is if there’s a tree with the magic power X.
The first line contains two integer N0 and M(1≤N0,M≤103), the number of trees you initially know and the number of queries.
The next line are N0 integer a1,…,an (1≤ai≤105) as described above.
Then followed M lines with each line a integer X(1≤X≤105) as described above.
For each query:
If there is no such a tree print “NO”.
Otherwise find a solution that X=∑ai×ki and print N integer ki, which should be no greater than 64-bits integer in a line. If there are multiple solutions, print any of them.
Warning: do not print extra space or empty line!