/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
AtCoder マンションには 1 号室から N 号室までの N 個の部屋があります。
各 i 号室には S_i さんが 1 人で住んでいます。
あなたは X 号室の Y さん宛に荷物を届けようとしています。宛先が正しいかどうかを判定してください。
制約
- 1 \leq N \leq 100
- 1 \leq X \leq N
- N,X は整数
- S_i および Y は英小文字のみからなる長さ 1 以上 10 以下の文字列
入力
入力は以下の形式で標準入力から与えられる。
N S_1 S_2 \vdots S_N X Y
出力
X 号室に住んでいる人の名前が Y であるとき Yes、そうでないとき No と出力せよ。
入力例 1
3 sato suzuki takahashi 3 takahashi
出力例 1
Yes
3 号室に住んでいるのは takahashi さんであり、荷物の宛名と一致しています。
入力例 2
3 sato suzuki takahashi 1 aoki
出力例 2
No
1 号室に住んでいるのは sato さんであり、荷物の宛名である aoki と一致しません。
入力例 3
2 smith smith 1 smith
出力例 3
Yes
AtCoder マンションには異なる部屋に同じ名前の人が住んでいることがあります。
入力例 4
2 wang li 2 wang
出力例 4
No
Score : 100 points
Problem Statement
Mansion AtCoder has N rooms numbered from room 1 to room N.
Each room i is inhabited by one person named S_i.
You are to deliver a package addressed to Mr./Ms. Y in room X. Determine whether the destination is correct.
Constraints
- 1 \leq N \leq 100
- 1 \leq X \leq N
- N and X are integers.
- S_i and Y are strings consisting of lowercase English letters with length between 1 and 10, inclusive.
Input
The input is given from Standard Input in the following format:
N S_1 S_2 \vdots S_N X Y
Output
Print Yes if the name of the person living in room X is Y, and No otherwise.
Sample Input 1
3 sato suzuki takahashi 3 takahashi
Sample Output 1
Yes
The person living in room 3 is takahashi, which matches the name on the package.
Sample Input 2
3 sato suzuki takahashi 1 aoki
Sample Output 2
No
The person living in room 1 is sato, which does not match the name on the package, aoki.
Sample Input 3
2 smith smith 1 smith
Sample Output 3
Yes
Mansion AtCoder may have people with the same name living in different rooms.
Sample Input 4
2 wang li 2 wang
Sample Output 4
No