#C4564. Prime-Like Number
Prime-Like Number
Prime-Like Number
A number is considered prime-like if it contains exactly three distinct prime factors. In other words, for a positive integer \(n\), if the set of its prime factors has exactly three elements, then \(n\) is prime-like.
Your task is to write a program that reads an integer from the standard input and determines if it is prime-like. If it is, output YES
; otherwise, output NO
.
Note: The input is provided via standard input and the output must be produced on standard output.
inputFormat
The input consists of a single integer \(n\) (\(1 \le n \le 10^6\)), representing the number to be checked.
outputFormat
Output a single line containing YES
if \(n\) is prime-like (i.e., has exactly three distinct prime factors), otherwise output NO
.
30
YES