Postal Code

AtCoder
IDabc084_b
Time2000ms
Memory256MB
Difficulty
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 from `0` through `9`. ## Input Input is given from Standard Input in the following format: $A$ $B$ $S$ [samples]
Samples
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
API Response (JSON)
{
  "problem": {
    "name": "Postal Code",
    "description": {
      "content": "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$. Determin",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc084_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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`.\nYou are given a string $S$. Determin...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments