#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
using ll = long long;
void GordenGhost();
signed main(){
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
GordenGhost();
return 0;
}
void GordenGhost(){
vector<int>w(30);
for (int i=0;i<=23;i++){
cin>>w[i];
}
ll a;
while(1){
cin>>a;
if (a<0||a>23)return;
if (w[a]>50){
cout<<w[a]<<" Yes"<<endl;
}else{
cout<<w[a]<<" No"<<endl;
}
}
}
04-28
1503
01-01
475
04-27
4376
04-29
7731
09-05
1652
10-20
1775