From Richmond Green S.S.
About
import java.util.Scanner; public class BT {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc =new Scanner(System.in);
int N=sc.nextInt();
int Y =sc.nextInt();
int M = sc.nextInt();
int D = sc.nextInt();
for(int i=0;i<N;i++){
if(Y==1989 && M<=2 && D<=27){
System.out.println("YES");
}else if(Y<1989 && M<12 && D<31){
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
}