Cossack Vus and the Circle
Kozak Vus recently discovered a magical circle! This circle consists of vertices, where each vertex is connected to vertex for , and vertex is connected back to vertex . Each vertex has an associated value .
Kozak Vus is experimenting with the circle by selecting a number . If two adjacent vertices, and , have the same value , he cuts the circle along the arc between these two vertices. The goal is to determine if there exists a number such that Kozak Vus can make at least two cuts.
Input
The first line contains a single integer () — the number of vertices in the circle.
The second line contains integers () — representing the values at each vertex.
Output
Print "Yes" if it is possible to choose a number that allows Kozak Vus to make at least two cuts. Otherwise, print "No".