Check Semiprime

Check Semiprime

Hard Computer Mathematics Primes & Factorization 35 views
Explanation Complexity

Problem Statement

A semiprime has exactly two prime factors (counted with multiplicity). Print YES/NO.

Input Format

One integer n.

Output Format

YES or NO.

Example

21
YES

Constraints

2

Input / Output Format

Input Format
One integer n.
Output Format
YES or NO.
Constraints
2

Examples

Input:
21
Output:
YES

Example Solution (Public)

Computer Mathematics
Factor n and count total prime factors with multiplicity. YES if count==2.

Official Solution Code

Factor n and count total prime factors with multiplicity. YES if count==2.
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.