The statement is given in the title.
The approach to solving this problem depends on the constraints, which, for some reason, are not specified here. Or are they?
The input consists of a single line containing a sequence of numbers separated by spaces.
For each number in the sequence, print YES (on a separate line) if the number has appeared earlier in the sequence, or NO if it has not.
Example 1