Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
515 B
255
Indexable
Never
package LuyenCode;

import java.util.Scanner;



public class VL11 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		long n = sc.nextLong();
		
		if(Check_Prime(n)) { 
			System.out.println("YES");
		}else { 
			System.out.println("NO");
		}
	}  
	public static boolean Check_Prime(long n ) { 
		if(n < 2) { 
			return false; 
		} 
		for(int i = 2; i <= Math.sqrt(n); i++) { 
			if(n % i == 0) { 
				return false;
			}
		}
		
		return true;
	}

}