import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;  


// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);  
        int  t = sc.nextInt();
        while( t --> 0){
            int n = sc.nextInt();  
            int sum  = 0, x = 1;
            while(x < n){
                if(n % x == 0){
                    sum += x;
                    x++;
                }
            }
            if(sum==n){
                System.out.println("Yes");
            }
            else{
                System.out.println("No");
            }
        }

    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: