For this Question: Given an array A of N integers, find whether there exists three consecutive same integers in the array.The first line of the input contains an integer N.
The second line contains N space separated integers of the array A.

Constraints
3 <= N <= 1000
1 <= A[i] <= 100Output "Yes" if there exists three consecutive equal integers in the array, else output "No" (without quotes).Sample Input
5
1 2 2 2 4

Sample Output
Yes

Explanation: The segment [2, 2, 2] follows the criterion.

Sample Input
5
1 2 2 3 4

Sample Output
No, I have written this Solution Code: n=int(input())
li = list(map(int,input().strip().split()))
for i in range(0,n-2):
    if li[i]==li[i+1] and li[i+1]==li[i+2]:
        print("Yes",end="")
        exit()
print("No",end=""), In this Programming Language: Python, Now tell me if this Code is compilable or not?