#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define l long long
void frooty()
{
	l n;
	cin>>n;
	while(n!=0)
	{
		l div=n%10;
		if(n==7)
		{
			cout<<"Yes"<<endl;
			return ;
		}
		n/=10;
	}
	cout<<"No"<<endl;
	return ;
}
int main()
{
	l t=1;
	cin>>t;
	while(t--)
	{
		frooty();
	}
}