Problem:


Score : 200 points

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 from 0 through 9.

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.

Sample Input 1

3 4
269-6650

Sample 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.

Sample Input 2

1 1
---

Sample Output 2

No

S contains unnecessary -s other than the (A+1)-th character, so it does not follow the format.

Sample Input 3

1 2
7444

Sample Output 3

No



Sample input:
3 4
269-6650


Sample output:
Yes

Submission status: Accepted

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

A, B = iInM()
S = input()

ans = 'Yes'
for i in range(len(S)):
    if i == A:
        if S[i] != '-':
            ans = 'No'
            break
    else:
        if not S[i].isdigit():
            ans = 'No'
            break

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()

f = True
if s[a]!='-':
    f = False
if not s[:a].isnumeric() and s[a+1:].isnumeric():
    f = False
if '-' in s[:a]+s[a+1:]:
    f = False
if f:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input()
num = ['0','1','2','3','4','5','6','7','8','9']
ans = True
if len(S)==(A+B+1):
    for i in range(len(S)):
        if i == A:
            if S[i] == '-':
                pass
            else:
                ans = False
                break
        else:
            if S[i] in num:
                pass
            else:
                ans = False
                break
else:
    ans = False

if ans == True:
    print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
S = input()
if S[:A].isnumeric() and S[A] == '-' and S[A+1:].isnumeric():
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
A,B = map(int,input().split())
S = input()
array_S = list(S)

if not (1 <= A <= 5 and 1 <= B <= 5):
    sys.exit()

if len(S) != (A + B + 1):
    sys.exit()

for I in range(len(array_S)):
    if I == A:
        continue
    if not array_S[I].isdecimal():
        print('No')
        sys.exit()

if array_S[A] == '-' and len(S) == (A + B + 1):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
try:
    A = int(s[:a])
    B = int(s[b:])
    if s[a] == '-':
        print('Yes')
    else:
        print('No')
except:
    print('No')

Submission status: Accepted

Solution code:
a, b = [int(w) for w in input().split()]
s = input()

cond = True

if not s[:a].isnumeric():
    cond = False

if not s[a] == "-":
    cond = False

if not s[a+1:].isnumeric():
    cond = False

print("Yes" if cond else "No")

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
s = input()
flg = 1
for i in range(len(s)):
    if i == a: continue
    elif '0' <= s[i] <= '9': flg = 1
    else: 
        flg = 0
        break

if (len(s) == a+b+1 and s[a] == '-' and flg) :print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
S=input()

N={"0","1","2","3","4","5","6","7","8","9"}
F=True
for i in range(A+B+1):
    if i!=A:
        F&=(S[i] in N)
    else:
        F&=(S[i]=="-")

if F:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()

def isint(str):
    try: int(str)
    except: return False
    return True

if isint(s[:a]) == True and s[a:a+1] == "-" and isint(s[a+1:]) == True: print("Yes")
else:  print("No")

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
s=input()
flag=True
for i in range(a+b+1):
  if s[a]!="-":
    flag=False
  elif i!=a and not s[i].isdigit():
    flag=False
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
n=[str(i)for i in range(10)]
for i in range(a + b + 1):
 if(i==a and s[i]!='-')or(i!=a and s[i]not in n):
  print('No');exit()
print('Yes')

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input()
S1= S[:A]
S2 = S[A]
S3 = S[A+1:]

if S1.isdecimal() == 1 and S2 == '-' and S3.isdecimal() == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

A, B = map(int, input().split())
list_n = list(map(str, input().rstrip('\n').split("-")))
# print(list_n[0])
# print(list_n[1])
if len(list_n[0]) == A and len(list_n[1]) == B:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=list(input())
num=["0","1","2","3","4","5","6","7","8","9"]
flg=True
for i in range(len(s)):
    if i==a:
        if s[i]!="-":
            flg=False
            break
    else:
        if not(s[i] in num):
            flg=False
            break
if flg:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
if s[a] == "-":
	if (s[:a]+s[a+1:]).isdigit():
		print("Yes")
		exit()
print("No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
lst=["1","2","3","4","5","6","7","8","9","0"]
if len(s)==a+b+1:
    if s[a]=="-":
        switch=1
        for i in range(a+b+1):
            if i!=a:
                if not s[i] in lst:
                    switch=0
                    break
        if switch==1:
            print("Yes")
            exit()
        
print("No")

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
s = input()
for i in range(len(s)):
  if i == a:
    if s[i] != "-":
      print("No")
      break
  else:
    if not "0" <= s[i] <= "9":
      print("No")
      break
else:
  print("Yes")

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
res = 'Yes'
if not S[:A].isdecimal() or not S[A+1:].isdecimal() or S[A] != '-':
    res = 'No'

print(res)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
S=input()
print('Yes' if S[A]=='-' and S[:A].isdecimal() and S[A+1:].isdecimal() else 'No' )

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
 
if s.count("-")==1 and s[a]=="-":
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
if(s[a]=='-'):
    t = s[:a] + s[a+1:a+b]
#     print(t)
    if(t.isdigit()==True):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input()

if S.count("-")==1 and S[A]=="-":
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
S=input()
a='Yes'
for i in range(A+B+1):
  if i==A:
    if S[i]!='-':
      a='No'
  else:
    if S[i]=='-':
      a='No'
print(a)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
if a+b+1!=int(len(s)):
    print("No")
    exit()
for i in range(int(len(s))):
    if i==a:
        if s[i]!="-":
            print("No")
            exit()
    else:
        if s[i] not in ["0","1","2","3","4","5","6","7","8","9"]:
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = list(input())

for i in range(len(S)):
    if i <= A-1:
        if S[i] not in [str(i) for i in range(10)]:
            print('No')
            exit()
    if i == A:
        if S[i] != '-':
            print('No')
            exit()
    else:
        if S[i] not in [str(i) for i in range(10)]:
            print('No')
            exit()

print('Yes')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()


def is_digit(num):
    try:
        int(num)
        return True
    except ValueError:
        return False


a = S[:A]
x = S[A]
b = S[A+1:]

if x == "-":
    for num in [a, b]:
        if not is_digit(num):
            print("No")
            break
    else:
        print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import string

a, b = map(int, input().split())
s = list(input())
flag = True
hyphen_count = s.count("-")

if "-" in s and hyphen_count == 1:
  hyphen_position = s.index("-")
  
  for i in range(len(s)):
    if not s[i] in string.digits and i != hyphen_position:
      flag = False
    elif a != len(s[0:hyphen_position]):
      flag = False
    elif b != len(s[hyphen_position + 1:len(s)]):
      flag = False
    
else:
  flag = False

if flag:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
s=input()
S=[s[i] for i in range(len(s))]
N=A+B+1
c=0
num={str(i) for i in range(10)}
if S[A]=='-' and len(S)==N:
  c=1
  S.pop(A)
  for i in range(N-1):
    if 1-(S[i] in num):
      c=0
if c==1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
a,b = map(int,input().split())
s = list(input())
if s[a] != "-":
	print("No")
	sys.exit()
s[a] = 1
if not "-" in s:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
print("Yes" if S[A] == "-" and S.count("-") == 1 else "No")

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
ans = True
if S[A] != '-':
    ans = False
for i in range(len(S)):
    if i == A:
        continue
    if S[i] == '-':
        ans = False
if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

A, B = I()
S = list(input().split("-"))
n = len(S)

if n != 2:
    print("No")
else:
    a = len(S[0])
    b = len(S[1])
    if A == a and B == b:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import re
A, B = map(int,input().split())
S = input()

p = f"\d{{{A}}}-\d{{{B}}}"
pattern = re.compile(p)
if pattern.fullmatch(S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
A,B=map(int,input().split())
S=input()
for i in range(A):
    try:
        num=int(S[i])
    except:
        print("No")
        sys.exit()
if S[A]!="-":
    print("No")
    sys.exit()
for i in range(B):
    try:
        num=int(S[i+A+1])
    except:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
def resolve():
    A, B = map(int, input().split())
    S = input()
    C = "1234567890"
    for i in range(A):
        if S[i] in C:
            continue
        else:
            print("No")
            exit()
    if S[A] != "-":
        print("No")
        exit()
    for i in range(A+1, len(S)):
        if S[i] in C:
            continue
        else:
            print("No")
            exit()
    print("Yes")
resolve()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = str(input())
if s[a] == "-":
    if s[:a].isdecimal() == True and s[a+1:].isdecimal() == True:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
def resolve():
    N, M = [int(i) for i in input().split()]
    S = input().split(sep="-")
    if len(S) != 2 or len(S[0]) != N or len(S[1]) != M:
        print("No")
    else:
        print("Yes")


resolve()

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
s1 = s[0:a]
s2 = s[a]
s3 = s[a + 1:a + b + 1]
if "-" not in s1 and s2 == "-" and "-" not in s3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
num_list=[str(i) for i in range(10)]
s=input()
if s[a]=="-":
    s=s[:a]+s[a+1:]
    for i in range(len(s)):
        if s[i] not in num_list:
            print("No")
            exit()
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
num_list=[i for i in range(10)]
num_list=[str(i) for i in num_list]
s=input()
if s[a]=="-":
    s=s[:a]+s[a+1:]
    for i in range(len(s)):
        if s[i] not in num_list:
            print("No")
            exit()
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = list(input())
n = len(s)
ans = "No"
for i in range(n):
  if s[i] == "-":
    if a == i:
      ans = "Yes"
if s.count("-") > 1:
  ans = "No"
      
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
flag = 0
for i in range(a):
    if s[i]>='0' and s[i]<='9': pass
    else: flag=1
if s[a]!='-': flag=1
for i in range(a+1, len(s)):
    if s[i]>='0' and s[i]<='9': pass
    else: flag=1
if flag==1: print("No")
else: print("Yes")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
if s[a] == "-":
    c = 0
    for i in range(a+1+b):
        if s[i] == "-":
            c += 1
    if c >= 2:
        print("No")
    else:
        print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

A, B = map(int, input().split())
S = input()

if not('-' in S[:A]) and S[A]=='-' and not('-' in S[A+1:]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()

#A文字目までが数字か
check_1 = S[:A].isdecimal()
check_2 = S[A+1:].isdecimal()
check_3 = (S[A:A+1] == "-")

if check_1 & check_2 & check_3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
S=input()
check1=S[0:A]
check2=S[A+1:]
print("Yes" if check1.isdecimal()==True and check2.isdecimal()==True and S[A]=="-" else "No")

Submission status: Accepted

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    num="0123456789"
    A,B=map(int,input().split())
    S=input()
    sn=S[:A]+S[A+1:A+B+1]
    y=1
    for i in sn:
        if not i in num:
            y=0
            break
    if S[A]!="-":
        y=0
    if y==1:
        print("Yes")
    else:
        print("No")
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
s = input()

if s.count('-') == 1:
    x,y = s.split('-')
    if x.isdigit and y.isdigit and len(x) == n and len(y) == m:
        print ("Yes")
        exit ()

print ("No")

Submission status: Accepted

Solution code:
a,b = map(int, input().split())

s =input()

intlist = ["0","1","2","3","4","5","6","7","8","9"]

for i in range(a):
    if s[i] in intlist:
        pass
    else:
        print("No")
        exit()

if s[a] != "-":
    print("No")
    exit()
    
for j in range(a+1,a+1+b):
    if s[j] in intlist:
        pass
    else:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
import re
a, b = [int(x) for x in input().split()]
s = input()
print("Yes" if re.search("\\d{{{}}}-\\d{{{}}}".format(a, b), s) is not None else "No")

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    b, c = map(int, input().split())
    s = input()
    flag=True
    list = [str(i) for i in range(10)]
    for i in range(b+c+1):
        s1= s[i]
        if i < b:
            if s1 not in list:
                flag=False
        elif i > b:
            if s1 not in list:
                flag=False
        else:
            if s1!="-":
                flag=False

    if flag == True:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
flag = True

for i in range(a):
  if s[i] == '-':
    flag = False
    break

if s[a] != '-':
  flag = False

for i in range(a + 1, a + b + 1):
  if s[i] == '-':
    flag = False
    break

if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
flg = True
for i in range(a):
    if s[i] == '-':
        flg = False
if s[a] != '-':
    flg = False
for i in range(a + 1, a + b + 1):
    if s[i] == '-':
        flg = False
if flg:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
if s[a]!='-':
    print('No')
elif s.count('-')>1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
A,B=map(int, input().split())
s=input()

ng = 0
if not (s[0:A].isdecimal()):
  ng = 1
if s[A] != "-": ng = 1
if not (s[A+1:A+B+1].isdecimal()):
  ng = 1
if ng == 1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
if s.count('-') == 1 and s.index('-') == a:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()

if S[A] == '-' and S.count('-') == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()

if S[:A].isdigit() and S[-B:].isdigit() and S[A] == '-':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()

if len(s) == a+b+1 and s[a] == '-' \
    and s[:a].isdecimal() and s[a+1:].isdecimal():
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
S = input()
digits = set([str(i) for i in range(10)])

for i in range(a+b+1):
    if i == a and S[i] != '-':
        print('No')
        break
    elif i == a and S[i] == '-':
        continue

    if not S[i] in digits:
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
S = input()

c1 = S[A] == '-'
c2 = S[:A].isdecimal()
c3 = S[A+1:].isdecimal()
print('Yes' if c1 and c2 and c3 else 'No')

Submission status: Accepted

Solution code:
A,B=map(int,input().split());S=input();print('Yes'if S[:A].isdigit()and S[A]=='-'and S[B+1:].isdigit()else'No')

Submission status: Accepted

Solution code:
A,B=map(int,input().split());S=input();print('Yes'if S[:A].isdigit() and S[A]=='-' and S[B+1:].isdigit() else'No')

Submission status: Accepted

Solution code:
A,B=map(int,input().split());S=input();print('Yes' if S[:A].isdigit() and S[A]=='-' and S[B+1:].isdigit() else 'No')

Submission status: Accepted

Solution code:
A,B=map(int,input().split());S=input()
print('Yes' if S[:A].isdigit() and S[A]=='-' and S[B+1:].isdigit() else 'No')

Submission status: Accepted

Solution code:
import re
A,B=map(int,input().split());S=input()
print('Yes' if 1<=A<=5 and 1<=B<=5 and S[:A].isdigit() and S[A]=='-' and S[B+1:].isdigit() else 'No')

Submission status: Accepted

Solution code:
import sys
A, B = list(map(int, input().split()))
S = str(input())
flag = 0

if S[A] != "-":
  print("No")
  sys.exit()
else:
  for i in range(0,A):
    if 48 <= ord(S[i]) <= 57:
      flag = flag + 0
    else:
      flag = flag + 1
  for i in range(A+1,A+B+1):
    if 48 <= ord(S[i]) <= 57:
      flag = flag + 0
    else:
      flag = flag + 1
if flag != 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
if "-" not in s[:a - 1] and s[a] == "-" and "-" not in s[a + 1:]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
try:
    A = int(s[0:a])
    h = s[a]
    B = int(s[a+1:])
    if h != '-':
        print("No")
    else:
        print("Yes")
except ValueError:
    print("No")

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
try:
    int(S[:A]+S[A+1:])
    try:
        int(S)
        print("No")
    except:
        print("Yes")
except:
    print("No")

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()

fwd = S[0:A]
bwd = S[A+1:]
flag = 0
if fwd.isdigit() == True:
    if S[A] == '-':
        if bwd.isdigit() == True:
            flag = 1
if flag == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def resolve():
    A, B = list(map(int, input().split()))
    S = str(input())
    import re
    if S[A] != '-':
        print('No')
        return
    if re.match('[0-9]+', S[:A]) and re.match('[0-9]+', S[A+1:]):
        print('Yes')
        return

    print('No')


resolve()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def read():
    A, B = map(int, input().strip().split())
    S = input().strip()
    return A, B, S


def solve(A, B, S):
    return "Yes" if S.count("-") == 1 and S[A] == "-" else "No"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
if s[:a].isdecimal() and s[a] == '-' and s[a+1:].isdecimal():
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a,b = map(int, input().split())

s = list(input())

if len(s) != a+b+1:
  print("No")
else:
  for i in range(a):
    if s[i] == "-":
      print("No")
      exit()
  if s[a] != "-":
    print("No")
    exit()
  for j in range(a+1,a+b+1):
    if s[j] == "-":
      print("No")
      exit()
print("Yes")

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    S = input()
    for i in range(A+B+1):
        if i == A:
            if S[i] != "-":
                print("No")
                return
        elif not S[i].isdigit():
            print("No")
            return
    print("Yes")

main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import defaultdict, deque
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline()[:-1]


def solve():
    a, b = [int(x) for x in input().split()]
    s = input()
    if s[a] == '-' and s.count('-') == 1:
        print("Yes")
    else:
        print("No")
        
t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()



"""

1 4
7
RRRR
1 1 0 1
----
4

1 4
47
RCRR
1 1 0 1
----
-1

2 2
10
RR
RR
1 7
4 1
----
4

2 2
10
RR
RR
7 4
7 4
----
-1

3 3
8
RCR
RRC
RRR
1 1 1
1 1 1
1 3 1


3 3
1
RCR
RRC
RRR
1 1 1
1 1 1
1 3 1


"""

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
ans = ["0","1","2","3","4","5","6","7","8","9"]
ch1 = list(map(str,s[:a]))
if a > b:
    ch2 = list(map(str,s[a+b:]))
else:
    ch2 = list(map(str,s[a+1:]))
count = 0
for i in range(len(ch1)):
    if ch1[i] not in ans:
        count +=1
for j in range(len(ch2)):
    if ch2[j] not in ans:
        count += 1
if count == 0 and s[a] == "-":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
ans = ["0","1","2","3","4","5","6","7","8","9"]
ch1 = list(map(str,s[:a]))
ch2 = list(map(str,s[a+1:]))
count = 0
for i in range(len(ch1)):
    if ch1[i] not in ans:
        count +=1
for j in range(len(ch2)):
    if ch2[j] not in ans:
        count += 1
if count == 0 and s[a] == "-":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b = i2()
s = s()
if "-" in s[0:a] or "-" in s[a+1:] or s[a] != "-":
	print("No")
else:
	print("Yes")

Submission status: Accepted

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b = i2()
s = s()
ls = [str(i) for i in range(10)]

for i in range(len(s)):
	if i < a or a < i:
		if s[i] not in ls:
			print("No")
			exit()
	else:
		if s[i] != "-":
			print("No")
			exit()
print("Yes")

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
if "-" in s[0:a] or "-" in s[a+1:] or s[a] != "-":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import math
from collections import deque
from collections import defaultdict

import bisect


#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b = readInts()
s = readChar()

if str.isdigit(s[:a]) and s[a]=="-" and str.isdigit(s[a+1:]):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
s = input()

if s[a] != '-':
  print('No')
  exit()
elif '-' in s[:a-1]:
  print('No')
  exit()
elif '-' in s[a+1:]:
  print('No')
  exit()
else:
  print('Yes')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
if s[a]=='-' and s.count('-')==1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
S_A, S_B = S[:A], S[A + 1:]
if len(S_A) == A and len(S_B) == B and S_A.isdigit() and S_B.isdigit() and \
   S[A] == '-':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[8]:


A, B = map(int, input().split())
S = input()


# In[11]:


flag = True
for x in S[:A]:
    if x == "-":
        flag = False
        break
if flag:
    for x in S[A+1:]:
        if x == "-":
            flag = False
            break
if flag:
    if S[A] != "-":
        flag = False
if flag:
    print("Yes")
else:
    print("No")


# In[ ]:

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()

if ('-' not in S[:A]) and ('-' == S[A]) and('-' not in S[A+1:]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
num=list(input())
non=False

for (i,c) in zip(range(0,a+b+1),num):
  if c=="-":
    if i==a:
      continue
    else:
      non=True
      break
  elif i==a:
    non=True
    break
    
if non:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = list(input())
t1 = s[:a]
t2 = s[a]
t3 = s[a+1:]

t1 = ''.join(t1)
t3 = ''.join(t3)

def is_int(s):
    try:
        int(s)
        return True
    except ValueError:
        return False

if is_int(t1) == True and is_int(t3) == True and t2 == '-':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
frag='Yes'

if len(s)!=a+b+1:
  frag='No'
else:
  if s[a]!='-':
    frag='No'
  elif s[:a].isdecimal()==False:
    frag='No'
  elif s[a+1:].isdecimal()==False:
    frag='No'
    
print(frag)