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: Runtime Error

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

if S.count("-") == 1:
    s1,s2 = S.split("-")
    if len(s1) == A:
        if len(s2) == B:
            print("Yes")
        else:
            print("No")
            sys.exit(0)
    elif len(s2) == A:
        if len(s1) == B:
            print("Yes")
        else:
            print("No")
            sys.exit(0)
    else:
        print("No")
        sys.exit(0)
else:
    print("No")

Submission status: Runtime Error

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

if S.count("-") == 1:
    s1,s2 = S.split("-")
    if len(s1) == A:
        if len(s2) == B:
            print("Yes")
        else:
            print("No")
    elif len(s2) == A:
        if len(s1) == B:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
        sys.exit(0)
else:
    print("No")

Submission status: Runtime Error

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

if S.count("-") == 1:
    s1,s2 = S.split("-")
    if len(s1) == A:
        if len(s2) == B:
            print("Yes")
    elif len(s1) == A:
        if len(s2) == B:
            print("Yes")
    else:
        print("No")
        sys.exit(0)
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A,B = map(int,input().split())
S = str(input())
if S[A] == "-":
  T = pop(S[A])
  if T.isdigit() is True:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A,B = map(int,input().split())
S = str(input())
if S[A] == "-":
  T = del S[A]
  if T.isdigit() is True:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
def abc084_b():
	import re
    a, b = map(int, input().split())
    return "Yes" if re.match("[0-9].*-[0-9].*", input()) else "No"


if __name__ == '__main__':
    print(abc084_b())

Submission status: Runtime Error

Solution code:
    import re
    a, b = map(int, input().split())
    return "Yes" if re.match("[0-9].*-[0-9].*", input()) else "No"


if __name__ == '__main__':
    print(abc084_b())

Submission status: Runtime Error

Solution code:
def issigit(s):
  return all(c in '0123456789' for c in s)

def check(s, a, b):
  if len(s) != a + b + 1:
    return False
  
  if not isdigit(s[:a]):
    return False
  
  if s[a] != '-':
    return False
  
  if not isdigit(s[-b:]):
    return False
  
  return True
  
a, b = map(int, input().split())
s = input()
if check(s, a, b):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
s = list(input())
if s[a] == "-" and len(s) == a+b+1:
  s.remove(s[a])
  for i in range(a+b):
    if i.is_integer() == False:
      print("No")
      break
  else:
    print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a.b = map(int,input().split())
s = list(input())
if s[a] == "-" and len(s) == a+b+1:
  s.remove(s[a])
  for i in range(a+b):
    if i.is_integer() == False:
      print("No")
      break()
  else:
    print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = list(map(int, input().slpit()))
s = input().split('-')

if len(s) != 2:
    print('No')
elif len(s[0]) == a and len(s[1]) == b:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
S = input()
L = list(range(10))
flag = True
for i in range(A+B+1):
    if ( i == A ):
        if (S[i] != "-"):
            flag = False
    else:
        if (not (int(S[i]) in L)):
            flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
3 4
269-6650

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
s=input()
if '-' not in s or s.count('-')>1 or s[0]=='-' or s[-1]=='-':
    print('No')
    exit()

p=s.split('-')
print('No' if s[a]!='-' or len(p[0]!=a or len(p[1])!=b) else 'Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# 関数 solve は，もちろん，問題に応じて書き換える
imprt sys

def solve(a,b,c):
    if a+b+1==len(c):
        if c.count('-')==1:
            return 'Yes'
        if c.count('-')!=1:
            return 'No'
    else:
        return 'No'
    
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c):
    a=0
    b=0
    if c.count('-')==1:
        return 'Yes'
    if c.count('-')!=1:
        return 'No'
    
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve( lst_a, lst_b,n):
    if n.count("-")==1:
        answer= "No"
    else:
        N,NN=n.split("-")
        if lst_a == len(N) and lst_b == len(NN):
            answer = "Yes"
        else:
            answer = "No"
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve( lst_a, lst_b,n):
    if n.count("-")>=2:
        answer= "No"
    else:
        N,NN=n.split("-")
        if lst_a == len(N) and lst_b == len(NN):
            answer = "Yes"
        else:
            answer = "No"
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve( lst_a, lst_b,n):
    if n.count("-")>=2:
        return "No"
    else:
        N,NN=n.split("-")
        if lst_a == len(N) and lst_b == len(NN):
            answer = "Yes"
        else:
            answer = "No"
    return answer
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve( lst_a, lst_b,n):
    if n.count("-")>=2:
        return "No"
    else:
        N,NN=n.split("-")
        if lst_a == len(N) and lst_b == len(NN):
            answer = "Yes"
        else:
            answer = "No"
    return answerr

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def solve( lst_a, lst_b,n):
    if n.count("-")>=2:
        return "No"
    else:
        N,NN=n.split("-")
        if lst_a == len(N) and lst_b == len(NN):
            answer = "Yes"
        else:
            answer = "No"
    return answer
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    n = int(line1)
    lst_a = []
    lst_b = []
    for i in range(n):
        line = sys.stdin.readline()
        [str_a, str_b] = line.rstrip().split(' ')
        lst_a.append(int(str_a))
        lst_b.append(int(str_b))
    return (n, lst_a, lst_b)

def main():
    n, lst_a, lst_b = readQuestion()
    answer = solve(n, lst_a, lst_b)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(s,a,b):
    c = 0
    for i in s:
        if i=='-':
            c+=1
    if  s[a]=='-' and c==1:
        return 'yes'
    else:
        return 'No'

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

try:
    if '-' not in s: raise 
    sa, sb = map(int, s.split('-'))
#     print(sa, sb)
    if len(sa)==a and len(sb)==b:
        print('Yes')
except ValueError:
    print('No')

Submission status: Runtime Error

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

if len(s) == (a+b+1) and all([c != '-' for c in s[:a]+s[a+1:]]) and s[a] == '-':
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
def number(c):
    c = str(c)
    ans = 0
    s = "0123456789"
    for i in range(10):
        if c == s[i]:ans = 1
    return ans

A,B = map(int,input().split())
S = input()
flag = 1
for i in range(A):
    if(number(S[i]) != 1):flag = 0
if S[A] != "-":flag = 0
for j in range(B):
    if(number(S[A+1+i]) != 1):flag = 0
if flag:print("Yes")
else:print("No")

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
a, b = input().split("-")
if len(a)==A and len(b)==B:
    print("Yes")
    exit()
print("No")

Submission status: Runtime Error

Solution code:
A,B=[int(i) for i in input().split()]
S = input()

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

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
S = list(input())
if A+B+1-S != 0:
    print("No")
    exit()
for i in range(len(S)):
    if (ord(S[i]) < ord("0") or ord(S[i]) > ord("9")) ^ i == A:
        print("No")
        exit()
print("Yes")

Submission status: Runtime Error

Solution code:
a, b = list(map(int, input().split()))
x, y = input().split('-')
print('Yes') if a==len(x) and b==len(y) else print('No')

Submission status: Runtime Error

Solution code:
# --*-- encoding:utf-8 --*--

ab = list(map(int, input())).split(" ")
code = input()

notflag = False
for i in range(a):
	if( code[i] not in "123456789" ):
        notflag = True

if( code[a] != "-" ):
	notflag = True

for i in range(a+1, b):
	if( code[i] not in "123456789" ):
		notflag = True

if(notflag == False):
	print "Yes"
elif:
	print "No"

Submission status: Runtime Error

Solution code:
input_str = str(input()).split(" ")
a = int(input_str[0])
b = int(input_str[1])
s = str(input()).split("-")


if a==3 and b ==4:
	for i in range(999):
		for j in range(9999):
			c = int(s[0])
			d = int(s[1])
			if i == c and j == d:
					print("yes")
else:
	print("no")

Submission status: Runtime Error

Solution code:
A, B= [int(input() )for _ in range(2)]
S = str(input())

if ((S[:A]+S[A+1:]).isdigit()) == True:  
    if S[A]=="-":
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Runtime Error

Solution code:
A, B= [int(input() )for _ in range(2)]
S = str(input())

if ((S[:A]+S[A+1:]).isdigit()) &  (S[A]=="-"):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
A, B= [int(input() )for _ in range(2)]
S = list(input())

if ("".join(S[0:A]+S[B:]).isdigit()) & (S[A]=="-"):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
A, B= [int(input() )for _ in range(2)]
S = str(input())

try:
    if type(int(S[:A]+S[A+1:]))!= int:
        print("No")
    elif S[A]!="-": 
        print('No')
    else:
        print('Yes')
except:
    print("No")

Submission status: Runtime Error

Solution code:
A, B= [int(input() )for _ in range(2)]
S = str(input())

try:
    if (type((int(S[:A])+int(S[A+1:])))== int):
        if S[A]=="-": 
                print('Yes')
    else:
        print('No')
except:
    print("No")

Submission status: Runtime Error

Solution code:
A, B= [int(input() )for _ in range(2)]
S = str(input())

try:
    if (type(int(S[:A]))== int):
        if S[A]=="-": 
            if type(int(S[A+1:]))==int:
                print('Yes')
    else:
        print('No')
except:
    print("No")

Submission status: Runtime Error

Solution code:
A, B= [int(input() )for _ in range(2)]
S = str(input())

try:
    if (type(int(S[:A]))== int) & (S[A]=="-") & (type(int(S[A+1:]))==int):
        print('Yes')
    else:
        print('No')
except:
    print("No")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
s = list(input())
ans = Yes
if len(s) != a+b+1:
    ans = 'No'
else:
    for i in range(a+b+1):
        if i == a and s[i] != '-':
            ans = 'No'
            break
        if (not s[i].isdigit()) and i != a:
            ans ='No'
            break
print (ans)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
s = list(input())
ans = True
for i in range(a+b+2):
    if i == a and s[i] != '-':
        ans = 'No'
    if not s[i].isdigit() and i != a:
        ans ='No'
        break
    if s[i].isdigit() and i != a:
        if 0>int(s[i]) or int(s[i]) > 9:
            ans ='No'
            
print (ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    
    A, B = [int(x) for x in input().split(' ')]
    S = input()

    S = S.split('-')
    if S.length < 2:
        print('No')

    a = S[0]
    b = S[1]

    if a.length == A:
        if b.length == B:
            print('YES')
            exit()

    print('No')

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
s = input()
import sys
if len(s) != a + b + 1:
  print('No')
else:
  for i in range(a):
    if !(s[i].isdigit()):
      print('No')
      sys.exit(0)
  for i in range(b):
    if !(s[len(a)+i+1].isdigit()):
      print('No')
      sys.exit(0)
  if s[len(a)] != '-':
    print('No')
  else:
    print('Yes')

Submission status: Runtime Error

Solution code:
A ,B = map(int, raw_input().split())
S = raw_input().split("-")
print len(S) == 2 and len(S[0]) == A and len(S[1]) == B ? "Yes" : "No"

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l = map(int, raw_input().split())
k = raw_input()
listed = list(k)
if (len(k) == (l[0] + l[1] + 1)) and (listed[l[0]] == "-") and ((int(listed[l[0]+1]) in range(10)) and ((int(listed[l[0]-1])) in range(10))):
    print "Yes"
else:
    print "No"

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
s = input()
first, second = s.split("-")
if len(first) == a and len(second) == b:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import math

A,B = input().split(" ")
s = str(input())

s_sp = s.split("-")

if (len(s_sp) != 2):
    print("No")
    exit

if (len(s_sp[0]) != int(A)) | (len(s_sp[1]) != int(B)):
    print("No")
    exit

if ((s_sp[0].isdigit()) & (s_sp[1].isdigit())):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#coding:utf-8

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

if S[A] != '-':
    print "No"

else:
    Flag = 0
    for i in range(A):
        if S[i] >= '0' and S[i] <= '9':
            Flag = 1
    for i in range(A+1,len(S)):
        if S[i] >= '0' and S[i] <= '9':
            Flag = 1

if Flag == 1:
    print "No"
else:
    print "Yes"

Submission status: Runtime Error

Solution code:
l = input().split()
a=input()

b=a.split("-")


if len(b[0]) == l[0] and len(b[1])==l[1] and and len(b)<3:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s=input()


try:
    s1,s2=s.split("-")
except Exception as e:
    print('No')
    sys.exit()

if(not s1.isdigit() or not s2.isdigit()):
    print('No')
    sys.exit()

if(len(s1)!=a or len(s2)!=b or len(s2)>5):
    print('No')
    sys.exit()

print('Yes')

Submission status: Runtime Error

Solution code:
AB = input()
S = input()

A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])

ints = "0123456789"


flag = True

if len(S) != A + B + 1:
    flag = False

if flag:
    for i in range(len(S)):
        if i != A:
            if not(S[i] in ints):
                flag = False
                return
        else:
            if S[i] != "-":
                flag = False
                return

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

Submission status: Runtime Error

Solution code:
A= int(input())
B = int(input())
S = input()
s1 = S[:A]
s2 = S[A:A+1]
s3= S[len(S)-B:]
if s1.isdigit() == True:
    if s2 == "-":
        if s3.isdigit() == True:
            print("Yes")
        else : 
            print("No")
    else:
        print("No")
else :
    print("No")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
  n = s.count('-')
  if n = 1:
    x,y = map(str, s.split('-'))
    if len(x) == a:
      if len(y) == b:
        ok = True

if ok:
  print 'Yes'
else:
  print 'No'

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
  n = s.count('-')
  if n <= 1:
    x,y = map(str, s.split('-'))
    if len(x) == a:
      if len(y) == b:
        ok = True

if ok:
  print 'Yes'
else:
  print 'No'

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
  x,y = map(str, s.split('-'))
  if len(x) == a:
    if len(y) == b:
      print ok

Submission status: Runtime Error

Solution code:

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <iterator>
#include <unordered_map>
#include <unordered_set>
#include <tuple> 
using namespace std;
typedef long long ll;

//input
//------------------------------------------
#define re(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T& t) { cin >> t; }
template<typename First, typename...Rest>void MACRO_VAR_Scan(First& first, Rest&...rest) { cin >> first; MACRO_VAR_Scan(rest...); }
#define rv_row(type, n, ...)vector<type> __VA_ARGS__;MACRO_VEC_ROW_Init(n, __VA_ARGS__); for(int i=0; i<n; ++i){MACRO_VEC_ROW_Scan(i, __VA_ARGS__);}
template<typename T> void MACRO_VEC_ROW_Init(int n, T& t) { t.resize(n); }
template<typename First, typename...Rest>void MACRO_VEC_ROW_Init(int n, First& first, Rest&...rest) { first.resize(n); MACRO_VEC_ROW_Init(n, rest...); }
template<typename T> void MACRO_VEC_ROW_Scan(int p, T& t) { cin >> t[p]; }
template<typename First, typename...Rest>void MACRO_VEC_ROW_Scan(int p, First& first, Rest&...rest) { cin >> first[p]; MACRO_VEC_ROW_Scan(p, rest...); }
#define rv(type, c, n) vector<type> c(n);for(auto& i:c)cin>>i;
#define rMAT(type, c, n, m) vector<vector<type>> c(n, vector<type>(m));for(auto& r:c)for(auto& i:r)cin>>i;  
void _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
// output
//------------------------------------------
#define pr(x) cout<<x<<endl;
#define prv(v){for(const auto& xxx : v){cout << xxx << " ";}cout << "\n";}
#define sankou(x,a,b) cout<<(x?a:b)<<endl;
#define hihumi(x,a,y,b,c) cout<<(x?a:y?b:c)<<endl;
#define YESNO(x) cout<<(x?"YES":"NO")<<endl;
#define yesno(x) cout<<(x?"Yes":"No")<<endl;
#define ck(x)  cerr << #x << " = " << (x) << endl;
#define ckv(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
//conversion
//------------------------------------------
inline ll toInt(std::string s) { ll v; std::istringstream sin(s);sin >> v;return v; }
template<class T> inline string toString(T x) { ostringstream sout;sout << x;return sout.str(); }
//math
//------------------------------------------
template<class T> inline T sqr(T x) { return x*x; }
template<typename A, typename B>inline void chmin(A &a, B b) { if (a>b)a = b; }
template<typename A, typename B>inline void chmax(A &a, B b) { if (a<b)a = b; }
ll qp(ll a, ll b) { ll ans = 1ll;do { if (b & 1)ans = 1ll * ans*a;a = 1ll * a*a; } while (b >>= 1);return ans; }
ll qpmod(ll a, ll b, ll mo) { ll ans = 1ll;do { if (b & 1)ans = 1ll * ans*a%mo;a = 1ll * a*a%mo; } while (b >>= 1);return ans; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline bool valid(int x, int h) { return 0 <= x && x < h; }
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTST(s,c) (((s).find(c)) != std::string::npos)
#define SORT(c) sort((c).begin(),(c).end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,val) (lower_bound(x.begin(),x.end(),val)-x.begin())
#define POSU(x,val) (upper_bound(x.begin(),x.end(),val)-x.begin())
#define FI first
#define SE second
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMINF(a) memset(a,0x3f,sizeof(a))//1e9<1061109567<INTMAX/2
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define FORll(i,a,b) for(long long i=(a);i<(b);++i)
#define repll(i,n) FORll(i,0,n)
#define rrep(i,a,b) for(int i=(int)(b)-1;i>=a;i--)
#define rrepll(i,a,b) for(long long i=(b)-1ll;i>=a;i--)
#define fo(x,c) for(auto &x : c)

#define repeat(i,a,b) for(int i=(a);i<=(b);++i)
//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<pair<int, int>> vpii;
//constant
//------------------------------------------
const double EPS = 1e-8;
const double PI = acos(-1.0);
const int INF = (int)(1e9) + 7;
const ll MOD = (ll)(1e9) + 7;
const ll MOD2 = (ll)(1e18) + 9;
#define ADD(a, b) a = (a + ll(b)) % MOD
#define MUL(a, b) a = (a * ll(b)) % MOD
const ll INF2 = (ll)(1e18);
const ll INTMAX = (0x7FFFFFFFL);
const ll LLMAX = (0x7FFFFFFFFFFFFFFFL);
const int N4 = (int)1e4 + 10;
const int N5 = (int)1e5 + 10;
int dx[8] = { 1, 0, -1, 0 , 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, -1, -1,  1, 1 };
//------------------------------------------


ll ans, cnt, ret, cur, f;




void _main() {
    re(int, a, b);
    re(string, s);

    if (s[a] == '-') {
        s[a] = ' ';
        f = 1;
        FOR(i, 0, a)f &= (0 <= s[i]-'0' &&  s[i] - '0' <= 9);
        FOR(i, a + 1, b + 1)f &= (0 <= s[i] - '0' && s[i] - '0' <= 9);
    }

    yesno(f);

}

Submission status: Runtime Error

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