import std.stdio;
import std.conv;
import std.algorithm;
import std.string;
import std.file;
 
int main() {
        int[] hs;
        string l;
        readln();
        while((l = readln()).length >= 2){
                if(l.split()[0] == l.split()[1] && l.split()[1] == l.split()[2]) printf("YES\n");
                else printf("NO\n");
                }
        return 0;
}