#include<stdio.h>
int sum,n,b[1000],i,t,j,c,k;
int main(){
//printf("enter test cases");
scanf("%d",&t);
printf("\n");
while(t>0){
sum=0;
k=0;
// printf("enter no");
scanf("%d",&n);
printf("\n");
for(i=0;i<n;i++){
scanf("%d",&b[i]);
sum=sum+b[i];
if(b[i]==0){
k=1;
}
}
if(sum<100){
printf("NO\n");
}
else {
if(sum==100){
printf("YES\n");
}
else{
c=sum-100;
j=c/10;
j=j+1;
if((c+j+k)<=n){
printf("YES\n");
}
else
printf("NO\n");
}
}
t--;
}
}