#K41722. Butterfly Migration Verification

    ID: 26929 Type: Default 1000ms 256MiB

Butterfly Migration Verification

Butterfly Migration Verification

You are given a list of marked butterfly IDs and a list of observed butterfly IDs during a migration. For each marked butterfly, determine if it has been observed again during the migration. Output YES if the butterfly has been observed, otherwise output NO.

Mathematically, for each marked ID \( i \), if \( i \in \text{observed set} \) then output "YES"; otherwise, output "NO".

The input will be read from stdin and the output should be written to stdout.

inputFormat

The first line contains an integer \( n \) which denotes the number of marked butterflies. The second line contains \( n \) space-separated strings representing the IDs of the marked butterflies.

The third line contains an integer \( m \) which denotes the number of observed butterflies. The fourth line contains \( m \) space-separated strings representing the IDs of the observed butterflies.

You may assume that 1 \(\leq n, m \leq 10^5\) and each ID is a non-empty string without spaces.

outputFormat

Output \( n \) lines. Each line should contain "YES" if the corresponding marked butterfly ID is found among the observed butterflies, otherwise output "NO".

## sample
5
butterfly1 butterfly2 butterfly3 butterfly4 butterfly5
3
butterfly2 butterfly5 butterfly7
NO

YES NO NO YES

</p>