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

Solution (Python):
a, b = map(int, input().split())
S = input().split("-")

if len(S[0]) == a and len(S[1]) == b:
    print("Yes")
else:
    print("No")

Solution (Python):
A, B = map(int, input().split())
S = input()
flag = True

for i in S[:A]:
  if i == '-':
    flag = False
if S[A] !='-':
  flag = False
for i in S[A+1:A+B+1]:
  if i == '-':
    flag = False
   
if flag:
  print('Yes')
else:
  print('No')

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

Solution (Python):
A, B = map(int, input().split())
S = list(str(input()))
flg = 1
digit = ['1','2','3','4','5','6','7','8','9','0']
if len(S) != A+B+1:
  flg = 0
elif S[A] != '-':
  flg = 0
else:
  for i in range(0, A):
    if S[i] not in digit:
      flg = 0
      break
  for i in range(A+1,A+B+1):
    if S[i] not in digit:
      flg = 0
      break
if flg:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b = f()
    s = input()

    for i in range(a+b+1):
        if i == a:
            if s[i] != '-':
                print('No')
                return
        else:
            if s[i] not in [str(k) for k in range(10)]:
                print('No')
                return

    
    print('Yes')


solve()

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

Solution (Python):
A,B=map(int,input().split())
S=input()
F=S[:A]
B=S[A+1:]
Key=True
if S.count('-')!=1: Key=False
if F.isdigit()==False: Key=False
if B.isdigit()==False: Key=False
if Key==True: print('Yes')
else: print('No')

Solution (Python):
A,B=map(int,input().split())
z=input().split("-")
if len(z) != 2:
	print("No")
else:
	print("Yes" if len(z[0])==A and len(z[1])==B else "No")

Solution (Python):

def read_input():
    a, b = map(int, input().split())
    s = input()
    return a, b, s

def check_digit(s, n):
    if len(s) != n:
        return False

    for c in s:
        if c not in '1234567890':
            return False
    return True


def submit():
    a, b, s = read_input()

    former = s[:a]
    hi = s[a]
    latter = s[a+1:]

    if check_digit(former, a) and hi == '-' and check_digit(latter, b):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    submit()

Solution (Python):
A,B = map(int,input().split())
S = input()
if S[A] == "-":
    S = S[:A]+S[A+1:]
    if S.isdigit():
        print("Yes")
        exit()
print("No")

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

if s[a] != "-":
    print("No")
    exit()

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

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

Solution (Python):
a, b = map(int, input().split())
s = input()
print("YNeos"[not all([(s[i] != '-' if i != a else s[i] == '-') for i in range(a + b + 1)])::2])

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

ok = False
if s.count("-") == 1:
  ind = s.index("-")
  if len(s[:ind]) == a and len(s[ind+1:]) == b:
    ok = True

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

Solution (Python):
A,B = map(int,input().split())
s = input().split("-")
ans = "Yes"
if len(s) != 2:
    ans = "No"
elif len(s[0]) != A or len(s[1]) != B:
    ans = "No"
print(ans)

Solution (Python):
A,B = map(int,input().split())
s = list(input())
ans = "Yes"
for i in range(A+B+1):
    if 0 <= i < A or A < i <= A+B:
        if s[i] == "-":
            ans = "No"
            break
    if i == A:
        if s[i] != "-":
            ans = "No"
            break
if len(s) != A+B+1:
    ans = "No"
print(ans)

Solution (Python):
import sys
from collections import Counter

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

for i in range(len(s)):
    if i <= a-1:
        if not s[i].isdigit():
            print('No')
            sys.exit()
    elif i == a:
        if not s[i] == '-':
            print('No')
            sys.exit()
    elif i <= a + b + 1:
        if not s[i].isdigit():
            print('No')
            sys.exit()
    else:
        print('No')
        sys.exit()

print('Yes')

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

if S[A]!="-":
    print("No")
    sys.exit()
try:
    a = int(S[:A])
    a = int(S[A+1:])
    print("Yes")

except:
    print("No")

Solution (Python):

a, b = list(map(int, input().rstrip().split()))
s = input()
if s[a] != "-":
    print("No")
else:
    for i in range(a + b + 1):
        if i == a:
            continue
        if s[i] not in "0123456789":
            print("No")
            break
    else:
        print("Yes")

Solution (Python):
[A,B] = list(map(int,input().split()))
S = input()
if S[A] != "-" or ("-" in S[:A]) or ("-" in S[-B:]):
    print("No")
else:
    print("Yes")

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

if S.count('-') != 1:
    ans = 'No'
else:
    pos = S.find('-')
    if pos == A:
        ans = 'Yes'
    else:
        ans = 'No'
    
print(ans)

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
	
def main():
	A, B = map(int, input().split(" "))
	S = input()
	tmp = S.split("-")
	
	if len(tmp) != 2:
		print("No")
		sys.exit()
	
	if tmp[0].isdecimal() == False or tmp[1].isdecimal() == False:
		print("No")
		sys.exit()
	
	if len(tmp[0]) == A and len(tmp[1]) == B:
		print("Yes")
	else:
		print("No")
	
	
if __name__ == "__main__":
	main()

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

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

Solution (Python):
A, B = map(int, input().split())
S = input()
ans = "No"
if S[: A].isdigit():
	if S[-B:].isdigit():
		if S[A] == "-":
			ans = "Yes"
print(ans)

Solution (Python):
def postalcode(a,b,s):
    if s[a]!="-":
        return "No"
    numbers=[str(i) for i in range(10)]
    for i in s[:a]+s[-b:]:
        if i not in numbers:
            return "No"
    return "Yes"

a,b=map(int,input().split())
s=input()
print(postalcode(a,b,s))

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

Solution (Python):
A,B = [int(x) for x in input().split()]
S = input()
flag = True
for ind,i in enumerate(S):
  if(ind!=A):
      if(ord(i)<48 or 57<ord(i)):
         flag = False
         break
  else:
      if(i!='-'):
         flag = False
         break
if(flag):
     print('Yes')
else:
     print('No')

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

Solution (Python):
A,B = map(int, input().split())
S = str(input())
bool = True

if S[A] == '-':
    for i in range(A):
        if S[i] == '-':
            bool = False
    
    for j in range(B):
        if S[-i] == '-':
            bool = False
else:
    bool = False
            
print('Yes' if bool else 'No')

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

if len(S) == A+B+1:
    for i in range(A+B+1):
        if i != A:
            if S[i] == '-':
                print('No')
                quit()
        else:
            if S[i] != '-':
                print('No')
                quit()
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
a,b = map(int,input().split())
S = list(input())
ans = 0
if S.count('-') != 1 :
    ans -= 1
else :
    if S[a] != '-' :
        ans -= 1

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

Solution (Python):
import sys

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

for i in range(A+B+1):
    if i != A:
        if S[i] == '-':
            print('No')
            sys.exit()
    else:
        if S[i] != '-':
            print('No')
            sys.exit()

print('Yes')

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

Solution (Python):
A, B= map(int, input().split())
S = input()
s = S.split('-')
if len(s) != 2:
    print('No')
else:
    print('Yes' if len(s[0]) == A and len(s[1]) == B else 'No')

Solution (Python):
A,B = map(int,input().split())
S = list(input())
judge = 1

if(len(S) < A):
  judge = 0
for i in range(len(S)):
 if(i == A):
  if(S[i] != '-'):
    judge = 0
    break
 else:
  if(S[i] == '-'):
    judge = 0
    break
    
if(judge == 0):
  print('No')
else:
  print('Yes')

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

s = S.split("-")
if S[A] == "-" and s[0].isdigit() and s[1].isdigit() and A == len(s[0]) and B == len(s[1]):
	print("Yes")
else:
	print("No")

Solution (Python):
A,B=map(int,input().split())
S=input()
s_list=[]
for i in range(10):
    s_list.append(str(i))
for i in range(A):
    if S[i] not in s_list:
        print("No")
        exit()
if S[A]!='-':
    print("No")
    exit()
for i in range(A+1,A+1+B):
    if S[i] not in s_list:
        print("No")
        exit()
print("Yes")

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

for i in range(A):
    if S[i] == "-":
        print("No")
        exit()

if S[A] != "-":
    print("No")
    exit()

for i in range(A+1,A+1+B):
    if S[i] == "-":
        print("No")
        exit()

print("Yes")

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

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

s = input()
n = s[:a]+s[a+1:]

print("Yes" if s[a]=="-" and n.isdigit() else "No")

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

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

Solution (Python):
a,b=map(int,input().split())
s=list(str(input()))
flag=False
numls=[str(i) for i in range(10)]
if s[a]!="-":
    flag=True
else:
    for i in range(a-1):
        if s[i] not in numls:
            flag=True
    for j in range(b):
        if s[a+j+1] not in numls:
            flag=True
print("YNeos"[flag::2])

Solution (Python):
n,m=map(int,input().split())
s=input()
flag=True
if s[n:n+1]!='-':
  flag=False
for i in range(n):
  if s[i]=='-':
    flag=False
for i in range(n+1,len(s)):
  if s[i]=='-':
    flag=False
if flag:
  print('Yes')
else:
  print('No')

Solution (Python):
a,b=map(int,input().split())
s=input()
list=[str(i) for i in range(10)]
print("Yes" if all([s[i] in list for i in range(a)]) and s[a]=="-" and all([s[i] in list for i in range(a+1,a+b+1)]) else "No")

Solution (Python):
A, B = map(int, input().split())
S = list(input())
suji = [str(i) for i in range(0, 10)]
try:
    a = int("".join(S[:A]))
    b = int("".join(S[B:]))
    if (S[A] in suji):
        print("No")
    else:
        print("Yes")
except:
    print("No")

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

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

Solution (Python):
A,B=map(int,input().split())
S=input()
flag=False
for i in range(len(S)):
  if i!=A and ((ord(S[i])-ord('0'))<0 or 9<(ord(S[i])-ord('0'))):
    break
  if i==A and S[i]!='-':
    break
  
  if i==len(S)-1:
    flag=True
    
if flag:
  print('Yes')
else:
  print('No')

Solution (Python):
A, B = map(int, input().split())
S = input()
ans = 'Yes'
if S[:A].isdecimal() == 0\
or S[A:A+1] != '-'\
or S[A+1:].isdecimal() == 0:
    ans = 'No'
print(ans)

Solution (Python):
A, B = map(int, input().split())
S = input()
falg = False

if S.count('-') == 1: 
  code_1, code_2 = S.split('-')
  if (len(code_1) == A) and (len(code_2) == B):
    flag = True
  else:
    flag = False

  if (code_1+code_2).isdecimal() and flag:
    flag = True
  else:
    flag = False

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

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

Solution (Python):



import math


a,b = map(int, input().split())
s = str(input()).split("-")

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

Solution (Python):
def main():
    A, B = map(int, input().split())
    S = input()
    print('YNeos'[not(
        S[A] == '-' and
        len(S[:A]) == A and S[:A].isdecimal() and
        len(S[A + 1:]) == B and S[A + 1:].isdecimal()
    )::2])


main()

Solution (Python):
def main():
    A, B = map(int, input().split())
    S = input()
    s = S.split('-')
    if len(s) != 2:
        print('No')
    else:
        x = s[0]
        y = s[1]
        print(
            'YNeos'[
                not (
                    len(x) == A and
                    len(y) == B and
                    x.isdecimal() and
                    y.isdecimal()
                )::2
            ]
        )


main()

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

for i in range(len(s)):
    if i == a:
        if s[i]!='-':
            print('No')
            exit()
    else:
        if s[i]=='-':
            print('No')
            exit()

print('Yes')

Solution (Python):
a,s=open(0);print('YNeos'[s.count('-')!=1or'-'<s[int(a[0])]::2])

Solution (Python):
a,b = map(int,input().split())
s = input()
if s[a] != '-':
    print("No")
else:
    found = True
    for i in range(len(s)):
        if i != a and not s[i].isdigit():
            found = False
    if found:
        print("Yes")
    else:
        print("No")

Solution (Python):
a, b = map(int, raw_input().split())
s = str(raw_input())
if (s[a] == '-') & (s[:a].isdigit()) & (s[a + 1:].isdigit()):
	print 'Yes'
else:
	print 'No'

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

flag = True
for i in range(len(S)):
    if i == A:
        if S[i] != '-':
            flag=False
    else:
        if S[i] not in '0123456789':
            flag=False

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

Solution (Python):
a,b = map(int,input().split())
s = input()
bango = ['0','1','2','3','4','5','6','7','8','9']
answer ='No'
count = 0
if s[a] == '-':
	s = s[:a]+s[a+1:]
	for i in range(len(s)):
		if s[i] in bango:
			count +=1
	if count == len(s):
		answer = 'Yes'
print(answer)

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

if "-" not in S or len(S.split("-")) > 2:
    print("No")
    exit()

left,right = S.split("-")

if len(left) == A and len(right) == B:
    print("Yes")
else:
    print("No")

Solution (Python):
import re

a, b = [int(_) for _ in input().split()]
s = input()

m = re.match('[0-9]{{{0}}}-[0-9]{{{1}}}'.format(a, b), s)
print('Yes' if m else 'No')

Solution (Python):
a, b = map(int, input().split())
x = input().split("-")

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

if len(x[0])==a and len(x[1])==b:
  print("Yes")
  exit()

print("No")

Solution (Python):
import sys
a, b = list(map(int,input().split()))
x = input()
if not (x[0:a].isdigit()) & (len(x[0:a]) == a):
    print('No')
    sys.exit()
if x[a] != '-':
    print('No')
    sys.exit()
if not (x[a+1:a+1+b].isdigit()) & (len(x[a+1:a+1+b]) == b):
    print('No')
    sys.exit()
print('Yes')

Solution (Python):
a, b = [int(item) for item in input().split()]
s = input()
if s[:a].isdigit() and s[a] == "-" and s[-b:].isdigit() and len(s) == a+b+1:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b=map(int,input().split());s=input();print(['No','Yes'][s[0:a].isdigit()and s[a]=='-'and s[a+1:].isdigit()])

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

Solution (Python):
import re

A, B = map(int, input().split())
S = input()
p = '\d{{{0}}}-\d{{{1}}}'.format(A, B)
m = re.match(p, S)
print('Yes' if m else 'No')

Solution (Python):
A,B = map(int,input().split())
S = str(input())
len_S = len(list(S))
S[A].isdecimal()
if S[A] == "-" and S[0:A] != "-" and S[A+1:] != "-" and S[0:A].isdecimal()== True and S[A+1:].isdecimal() ==  True and len_S == A+B+1:
        print("Yes")
else:
        print("No")

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

Solution (Python):
import re
a, b = [int(n) for n in input().split()]
s = input()

pattern = '\d{' + str(a) + '}-\d{' + str(b) + '}'
if re.search(pattern, s) is None:
    print('No')
else:
    print('Yes')

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
A, B = map(int, input().split())
S = input()
Slist = list(map(ord, S))
del (Slist[A])

if S[A] == '-':
    if max(Slist) <= 57 and min(Slist) >= 48:
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

S = input()

for i in range (A):
  if S[i] == '-':
    print("No")
    exit()
  else:
      continue

for j in range(A,A+B+1):
  if j == A and S[j] != '-':
    print("No")
    exit()
  elif j>A and S[j] == '-':
    print("No")
    exit()
  else:
      continue
print("Yes")

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

Solution (Python):
a,b=map(int,input().split())
s=input()
num=[int(i) for i in range(10)]
ans='No'
ss=s[:a]+s[a+1:]
if s[a]=='-':
    if ss.isdecimal()==True:
        ans='Yes'
print(ans)

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

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

Solution (Python):
import re

A,B=map(int,input().split())
S=input()
f = r'^[0-9]{%d}-[0-9]{%d}$' % (A,B)
if re.search(f,S):
    print('Yes')
else:
    print('No')

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

Solution (Python):
def judge(a, b, s):
    num = [str(i) for i in range(10)]
    for i in range(a+b+1):
        if (s[i] in num and i != a)  or (s[a] == "-" and i == a):
            continue
        else:
            return "No"

    return "Yes"
            

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

Solution (Python):

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

Solution (Python):
a,b=(int(i) for i in input().split())
s=input().split('-')
if len(s)!=2:
    print('No')
elif len(s[0])!=a or len(s[1])!=b:
    print('No')
else:
    print('Yes')

Solution (Python):
A, B = map(int,input().split())
S = input()
if len(S) == A + B + 1:
    cnt = 0
    for x in S:
        if  x == '-':
            cnt += 1
    if cnt == 1 and S[A] == '-':
        print("Yes")
        quit()
print("No")

Solution (Python):
A, B = map(int,input().split())
S = input()
v = 0
if len(S) != A + B + 1:
    v = 1
for i in range(len(S)):
    if i!= A and S[i] not in [str(j) for j in range(10)]:
        v = 1
    if i == A and S[i] != '-':
        v = 1
if v == 1:
    print("No")
else:
    print("Yes")

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

def check(string):
    if '-' in string:
        print('No')
        quit()

if A + B + 1 != len(S) or S[A] != '-':
    print("No")
    quit()

check(S[:A])
rev_S = S[::-1]
check(rev_S[:B])

print("Yes")

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

Solution (Python):
from sys import stdin
a, b = [int(_) for _ in stdin.readline().rstrip().split()]
s = stdin.readline().rstrip()
substr = s[:a]+s[a+1:]
if s[a]=='-' and substr.isdigit():
    print('Yes')
else:
    print('No')

Solution (Python):

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

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

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

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

Solution (Python):

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

x = -1 == s[0:a].find('-')
y = -1 == s[a+1:].find('-')
z = -1 != s[a]=='-'


print('Yes' if x and y and z else 'No')

Solution (Python):
def solve(string):
    a, b, s = string.split()
    a = int(a)
    return "Yes" if s[a] == "-" and (s[:a] + s[a + 1:]).isdigit() else "No"


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Solution (Python):
a,b=map(int,input().split())
s=input()
f=0
for i in s:
    if i=="-":
        f+=1
if len(s)==(a+b+1) and s[a]=="-" and f==1:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b=map(int,input().split());s=input().split("-");ans="Yes"
if len(s)!=2:ans="No"
if len(s[0])!=a or len(s[1])!=b:ans="No"
if "--" in s:ans=="No"
print(ans)

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

Solution (Python):
A, B = list(map(int, input().split()))
S = input()
S = S.split("-")
if len(S) != 2:
  print("No")
else:
  if len(S[0]) == A and len(S[1]) == B:
    print("Yes")
  else:
    print("No")

Solution (Python):
A,B = map(int,input().split())
S = input()
ans = 0
for i in range(A+B+1):
    if i < A:
        if ord(S[i]) >= 48 and ord(S[i]) <= 57:
            ans += 1
    elif i == A:
        if ord(S[A]) == 45:
            ans += 1
    else:
        if ord(S[i]) >= 48 and ord(S[i]) <= 57:
            ans += 1
if ans == A+B+1:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b=map(int,input().split())
s=list(input())
if s[a]!='-':
  print('No')
  exit()
s.pop(a)
num=list('0123456789')
for i in range(a+b):
  if s[i] in num:
    continue
  else:
    print('No')
    exit()
print('Yes')

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

ans = True
for i in range(len(S)):
    if i == A:
        if S[i] != "-":
            ans = False
            break
    else:
        if S[i] == "-":
            ans = False
            break

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

Solution (Python):
A ,B = map(int,input().split())
S = input()
if S.count("-") == 1 :
    M, N = S.split("-")
    print("Yes" if len(M) == A and len(N) == B else "No")
else :
    print("No")

Solution (Python):
import re
A,B=map(int,input().split(' '))
print('Yes') if len(re.compile(r'^[0-9]{%d}-[0-9]{%d}$' % (A,B)).findall(input()))==1 else print('No')

Solution (Python):
a,b=map(int,input().split())
s=input()
print('NYoe s'[s.replace('-','').isdigit() and s.find('-')==a and len(s)==a+b+1 and s.count('-')==1::2])

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

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

Solution (Python):
A, B = map(int, input().split())
S = input()
flag = True

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

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

Solution (Python):
from collections import Counter

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

Solution (Python):
a=int(input()[0]);s=input();print("YNeos"[s.count("-")!=1or"-"<s[a]::2])

Solution (Python):
a=int(input()[0]);s=input();print("YNeos"[s.count("-")!=1or s[a]>"-"::2])

Solution (Python):
a=int(input()[0]);s=input();print("NYoe s"[a==s.find("-")==s.rfind("-")::2])

Solution (Python):
a=int(input()[0]);s=input();print("YNeos"[s[a]>"-"or"-"in s[:a]+s[a+1:]::2])

Solution (Python):
a,b=map(int,input().split())
s=input()
print("YNeos"[s[a]>"-"or"-"in s[:a]+s[a+1:]::2])

Solution (Python):
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B = IL()
s = S()

if s.count("-")==1 and s.index("-")==A:
  print("Yes")
else:
  print("No")

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

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

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


c = 0

for i in range(a):
	if p[i] != '-':
		c += 1
        
if p[a] == '-':
	c += 1
    
for i in range(b):
	if p[a+1] != '-':
		c += 1
        
if c == a + b + 1:
	print('Yes')
    
else:
	print('No')

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

Solution (Python):
import re
a, b = map(int, input().split())
s = input()
print('Yes' if re.match(r'^[0-9]{%s}\-[0-9]{%s}$' % (a, b), s) else 'No')

Solution (Python):
a,b = map(int,input().split())
n = input()
co = 0
if len(n) == a+b+1:
  for i in range(a+b+1):
    if n[i] == "-":
      if i != a:
        print("No")
        exit()
      else:
        co = 1
  if co == 1:
    print("Yes")
  else:
    print("No")
    
else:
  print("No")
  exit()

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

Solution (Python):
def postal_code(A: int, B: int, S: str)->bool:
    if '-' in S[:A]:
        return False
    if S[A] != '-':
        return False
    if '-' in S[-B:]:
        return False
    return True


if __name__ == "__main__":
    A, B = map(int, input().split())
    S = input()
    yes = postal_code(A, B, S)
    print('Yes' if yes else 'No')

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

h = s[a:a+1]
a = s[:a] 
b = s[-b:]

print("Yes") if a.isdigit() & b.isdigit() & (h == "-") else print("No")

Solution (Python):
def postal(a,b,s):
    if s[a]=='-':
        for i in (s[:a]+s[a+1:]):
            if i not in '0123456789':
                return 'No'
        return 'Yes'
    else:
        return 'No'
a, b = map(int, input().split())
s = input()
print(postal(a,b,s))

Solution (Python):
a, b = (int(i) for i in input().split())
s = input()

def f():
    if s.count("-") != 1:
        return "No"
    x = s.split("-")
    
    if len(x[0]) == a and len(x[1]) == b:
        return "Yes"
    return "No"

print(f())

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

Solution (Python):


import itertools
import collections
import bisect

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

    try:
        fir = int(S[:A])
        sec = int(S[B:])
    except ValueError:
        print("No")
        exit()

    if S[A] == '-':
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):
a,b=map(int,input().split())
hoge=input()
flag1=0
flag2=1
flag3=0
for i in range(a+b+1):
  if(hoge[i]=="-" and i<a):
    flag1=1
  if(hoge[i]=="-" and i==a):
    flag2=0
  if(hoge[i]=="-" and i>a):
    flag3=1

if(flag1==0 and flag2==0 and flag3==0):
  print("Yes")
else:
  print("No")

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

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())
    S = str(input().strip())
    if S[:A].isnumeric() and S[A] == '-' and S[A+1:].isnumeric():
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
A,B = map(int,input().split())
S = input()
ans = True
for i in range(len(S)):
    if i == A:
        if S[i] != "-":
            ans = False
    elif "0" > S[i] or "9" < S[i]:
        ans = False
print("YNeos"[not ans::2])

Solution (Python):
A,B = map(int,input().split())
S = [i for i in input().split("-")]
if len(S[0])==A and len(S[1])==B:
    print("Yes")
else:
    print("No")

Solution (Python):

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

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

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

Solution (Python):
A, B = map(int, input().split())
S = input()
s = S.split("-")
if len(s) != 2:
    print("No")
    exit()
if len(s[0]) == A and len(s[1]) == B:
    print("Yes")
else:
    print("No")

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

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