#include <iostream>
#include <cmath>
using namespace std;
//英语 抄博友程序 余弦定理 背
double cal(int x1,int y1,int x2,int y2)//抄博友程序 背
{
double pi=3.14159265358979;
double a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
double b=sqrt(x1*x1+y1*y1);
double c=sqrt(x2*x2+y2*y2);
return acos((b*b+c*c-a*a)/(2*b*c))/pi*180;
}
double fun(double x)//
{
if(x>=360)
{
x=x-360;
}
if(x<0)
{
x=360+x;
}
if(x>180)
{
x=360-x;
}
return x;//
}
int main()
{
int T;
cin>>T;
for(int o=0;o<T;o++)
{
int r,x1,y1,x2,y2,x3,y3;
cin>>r>>x1>>y1>>x2>>y2>>x3>>y3;
if((x1==0&&y1==0)||(x2==0&&y2==0)||(x3==0 && y3==0))//抄博友 英语
{
cout<<"No"<<endl;
continue;
}
double a=fun(cal(x1,y1,x2,y2));
double b=fun(cal(x2,y2,x3,y3));
double c=fun(cal(x1,y1,x3,y3));
double t=max(a,b);
t=max(t,c);
if(t>=120)//英语
{
cout<<"Yes"<<endl;
}else
{
cout<<"No"<<endl;
}
}
return 0;
}