This page is still under construction.

Parts of this page are still being built. What you see may change.

Federal Voting Age

Time limit1sMemory limit128 MB

Summary
For each birth date, decide whether the person is at least 18 years old on February 27, 2007.
Level

Easy2 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

An important election will be held on February 27, 2007, and the government has commissioned an electronic voting system. You have been hired as a sub-subcontractor on this very grand programming project.

Your task is to write the part of the system that decides whether a given person is old enough to vote. The voting age is 18, so given a person's date of birth, determine whether that person is at least 18 years old on election day, February 27, 2007.

Input

The first line contains an integer nn (1≤n≤1001 \le n \le 100), the number of birthdays to check. Each of the next nn lines contains three integers y m dy\ m\ d, where yy (0≤y≤20070 \le y \le 2007) is the birth year, mm (1≤m≤121 \le m \le 12) is the birth month, and dd (1≤d≤311 \le d \le 31) is the birth day. Every given date is guaranteed to be a valid calendar date.

Output

For each date, print Yes on its own line if that person is eligible to vote, or No otherwise.

Examples1

  1. Example 1

    Input
    5
    1933 10 29
    1989 2 28
    1961 11 23
    1999 12 31
    1989 2 27
    
    Expected output
    Yes
    No
    Yes
    No
    Yes