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: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
	int n = sc.nextInt();
	int a[] = new int[n];
	for(int i=0;i<n;i++){
	    a[i]=sc.nextInt();
	}
	for(int i=0;i<n-2;i++){
	    if(a[i]==a[i+1] && a[i+1]==a[i+2]){
	        System.out.print("Yes");
	        return;
	    }
	}
	System.out.print("No");
    
    
	

}
	    


}, In this Programming Language: Java, Now tell me if this Code is compilable or not?