Key Lookup


Submit solution

Points: 10
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

You are given a dictionary encoded as name:score pairs and a query. Determine whether the query is one of its keys.</p>

Input

The first line contains n (1 ≤ n ≤ 500000). The second line contains n space-separated name:score pairs with distinct keys. The third line contains the query. Names contain letters only and scores are integers.

Output

Print YES if the query key exists; otherwise print NO.

Examples

Input #1
3
An:9 Binh:8 Chi:10
Binh
Output #1
YES

Explanation #1: Binh is exactly one of the three keys; the score 8 does not affect membership.

Input #2
3
An:9 Binh:8 Chi:10
binh
Output #2
NO

Explanation #2: Keys are case-sensitive: binh and Binh are different strings.


Comments


  • 0
    admin  commented on July 16, 2026, 7:10 p.m.

    ngon luôn