Cossack Vus and the Circle#10745

Cossack Vus and the Circle

1 second
256 megabytes
Very easy

Recently, Cossack Vus found a magical circle! It has vertices arranged on it, such that vertices and i + 1 are adjacent for 1 \le i < n. Also, vertices numbered and are adjacent. Each vertex has its own value a_i.

Cossack Vus started performing the following actions with this circle. He chose a number . If vertices and are adjacent and a_i=a_j=x, then he cuts the circle along the arc connecting these two vertices. In other words, he makes a cut between two adjacent vertices whose values are equal to .

Is it possible to choose a number such that Cossack Vus makes at least two cuts?

Input

The first line contains one integer (2 \le n \le 50) — the number of vertices on the circle.

The second line contains integers a_1, a_2, \dots, a_n (1 \le a_i \le 50) — the array .

Output

Print «Yes» if it is possible to choose a number such that Cossack Vus makes at least two cuts, otherwise print «No».

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading