Prisoners of Musabad

Limits 2s, 512 MB

In the city of Musabad, criminals are punished heavily. Once an enemy is caught, he is kept in the jail forever. But the criminals of Musabad are clever, and they often break from the prison. Some of them even get caught one or more times after escaping from the prison. Each time a criminal enters the prison, his identity number is saved in some secret directory. Now, the warden is suspicious about the prison break and wants to find out those criminals who was arrested and put into prison at least twice during their lifetime.

Help Warden by writing the program for him.


The first line of the input contains the number n (1 ≤ n ≤ 1000), the number of prisoner entry records in the secret directory. The next line contains n space separated integers ai (-1000 ≤ ai ≤ 1000 ), where each ai in a unique identifier for each of the criminals. After that there is an integer m (1 ≤ m ≤ 106), the number of queries that the warden would make. The next line contains m space separated integers bi (-1000 ≤ bi ≤ 1000), denoting the identifier of the prisoner. These are the ids that the warden wants to investigate.


For each query, print "Yes" (w/o quotes), if the prisoner with the specified id has been arrested more than once. Otherwise, print "No" (w/o quotes).


1 2 3 4 5 1 2 3 4
5 4 3 2 1