For this Question: Given an integer N, your task is to check whether the given number is prime or notThe input contains a single integer N.

Constraints:-
1 <= N <= 100000000000Print "YES" If the given number is prime else print "NO".Sample Input:-
2

Sample Output:-
YES

Sample Input:-
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);
		long n = sc.nextLong();
		int p=(int)Math.sqrt(n);
		for(int i=2;i<=p;i++){
		   if(n%i==0){System.out.print("NO");return;}
		    
		}
		System.out.print("YES");
		
	}
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?