Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 100 点
問題文
明日からの 7 日間の天気予報を表す文字列 S が与えられます。
i 日後の予報は S の i 文字目が o
であるとき晴れ、x
であるとき雨です。
N 日後の天気予報が晴れかどうかを教えてください。
制約
- N は 1 以上 7 以下の整数
- S は長さ 7 の文字列であり、
o
とx
のみからなる
入力
入力は以下の形式で標準入力から与えられる。
N S
出力
N 日後の天気予報が晴れであるとき Yes
を、雨であるとき No
を出力せよ。
入力例 1
4 oooxoox
出力例 1
No
明日からの 7 日間の天気予報は順に、晴れ、晴れ、晴れ、雨、晴れ、晴れ、雨です。
特に、今日から 4 日後の天気予報は雨です。
入力例 2
7 ooooooo
出力例 2
Yes
Score : 100 points
Problem Statement
You are given a string S, which represents a weather forecast for the seven days starting tomorrow.
The i-th of those seven days is forecast to be sunny if the i-th character of S is o
, and rainy if that character is x
.
Tell us whether the N-th day is forecast to be sunny.
Constraints
- N is an integer between 1 and 7 (inclusive).
- S is a string of length 7 consisting of
o
andx
.
Input
Input is given from Standard Input in the following format:
N S
Output
Print Yes
if the N-th of the seven days starting tomorrow is forecast to be sunny, and No
if that day is forecast to be rainy.
Sample Input 1
4 oooxoox
Sample Output 1
No
The forecast for each of the seven days starting tomorrow is as follows: sunny, sunny, sunny, rainy, sunny, sunny, rainy.
In particular, the fourth day is forecast to be rainy.
Sample Input 2
7 ooooooo
Sample Output 2
Yes