Valid Integer
Is S a canonical integer literal: an optional sign, then digits with no leading zero (0 itself is fine)?
Input: one line with the candidate string S.
Output: YES or NO.
Constraints:
- 1 ≤ |S| ≤ 100
Sample Tests
Input 1
-102
Output 1
YES
Input 2
0102
Output 2
NO
Discussion (opens after you solve — no spoilers before)
No comments yet.