using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int n ,i,flg=1;
cin>>n;
long int a[n],k,x=0;
cin>>k;
for(i=0;i<n;i++)
{
cin>>a[i];
}
for(i=0;i<n;i++)
{
if((a[i]+x)>=k)
{
x = (a[i]+x)-k;
}
else
{
flg=0;
break;
}
}
if(flg == 1)
cout<<"YES"<<"\n";
else
cout<<"NO"<<" "<<i+1<<"\n";
}
return 0;
}