P26811 [AtCoder] Security
普及+
题目描述

Problem Description

Initially, there are $A$ people in the room, and then people enter and exit the room. We are concerned about whether there was a moment when the room was completely empty.

You are given a string $S$ representing the entry and exit of people. If the $i$-th character of $S$ is +, it means that at time $i$, one person entered the room. If it is -, it means that one person left the room.

Determine if the room has ever been empty, including before and after the recording started.

Input Format

The input is given from the standard input in the following format:

$A$ $S$

Output Format

If there was a moment when the room was empty, output Yes; otherwise, output No.

Sample Input and Output

Sample Input #1

3
+++---

Sample Output #1

No

Sample Input #2

4
+-----++-

Sample Output #2

Yes

Sample Input #3

0
++++

Sample Output #3

Yes

Notes/Hints

Constraints

  • $0 \leq A \leq 100$
  • $1 \leq |S| \leq 100$
  • $S$ consists of + or -
  • There are no records of - when the room is already empty
  • $A$ is an integer

Sample Explanation 3

Since the room was initially empty, output Yes.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 +++---
样例输出
No