import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        try {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        try {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
} Main public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        try {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    } main {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        try {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) try {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } IOException e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                in.close();
            } in.close() in.close in {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } Integer dataNum = Integer.valueOf(in.readLine()); dataNum Integer.valueOf(in.readLine()) Integer.valueOf Integer in.readLine() in.readLine in for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            } int i = 0; int i = 0; i 0 i < dataNum.intValue() i dataNum.intValue() dataNum.intValue dataNum i++ i++ i {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            } {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            } String[] problemData = in.readLine().split("\\s"); problemData in.readLine().split("\\s") in.readLine().split in.readLine() in.readLine in "\\s" int max = 0; max 0 int other1 = 0; other1 0 int other2 = 0; other2 0 for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                } String data problemData {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                } {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                } int dataInt = Integer.valueOf(data); dataInt Integer.valueOf(data) Integer.valueOf Integer data other2 = other1 other2 other1 if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    } dataInt > max dataInt max {
                        other1 = max;
                        max = dataInt;
                    } other1 = max other1 max max = dataInt max dataInt {
                        other1 = dataInt;
                    } other1 = dataInt other1 dataInt if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                } (max * max) == (other1 * other1 + other2 * other2) (max * max) max max (other1 * other1 + other2 * other2) other1 * other1 other1 other1 other2 * other2 other2 other2 {
                    System.out.println("YES");
                } System.out.println("YES") System.out.println System.out System System.out "YES" {
                    System.out.println("NO");
                } System.out.println("NO") System.out.println System.out System System.out "NO" String[] args args public class Main{

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        try {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
} public class Main{

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        try {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        try {
            Integer dataNum = Integer.valueOf(in.readLine());

            for (int i = 0; i < dataNum.intValue(); i++) {

                String[] problemData = in.readLine().split("\\s");

                int max = 0;

                int other1 = 0;

                int other2 = 0;

                for (String data : problemData) {

                    int dataInt = Integer.valueOf(data);

                    other2 = other1;

                    if (dataInt > max) {
                        other1 = max;
                        max = dataInt;
                    } else {
                        other1 = dataInt;
                    }
                }

                if ((max * max) == (other1 * other1 + other2 * other2)) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}