AtCoder Beginner Contest 084
翻译中…
Problem Statement
翻译中…
The postal code in Atcoder Kingdom is $A+B+1$ characters long, its $(A+1)$-th character is a hyphen -, and the other characters are digits from 0 through 9.
翻译中…
You are given a string $S$. Determine whether it follows the postal code format in Atcoder Kingdom.
翻译中…
Constraints
翻译中…
$1≤A,B≤5$$|S|=A+B+1$$S$consists of-and digits from0through9.
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
A B
S
翻译中…
Output
翻译中…
Print Yes if $S$ follows the postal code format in AtCoder Kingdom; print No otherwise.
翻译中…
样例
Input #1
3 4
269-6650
Output #1
Yes
The $(A+1)$-th character of $S$ is `-`, and the other characters are digits from `0` through `9`, so it follows the format.
Input #2
1 1
---
Output #2
No
$S$ contains unnecessary `-`s other than the $(A+1)$-th character, so it does not follow the format.
Input #3
1 2
7444
Output #3
No
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。