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()
haihun = False
number = True

if S[A] == "-":
    haihun = True

if "-" in S[:A]:
    number = False

for i in S[A+1:]:
    if i == "-":
        number = False
        break
    if int(i) < 0 or int(i) > 9:
        number = False
        break
    else:
        continue


if haihun and number:
    print("Yes")
else:
    print("No")

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

Solution (Python):
A, B = map(int, input().split())
S = list(input())
num = '0123456789'
ans = 0

for i in range(A):
    for n in num:
        if S[i] == n:
            ans += 1

if S[A] == '-':
    ans += 1

for j in range(B):
    for n in num:
        if S[A + 1 + j] == n:
            ans += 1

if ans == A + B + 1:
    print('Yes')
else:
    print('No')

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

Solution (Python):
A, B = [int(ab) for ab in input().split()]
S = input()
N = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
for i in range(A+B):
  if i == A and S[i] == "-":
    continue
  elif i != A and S[i] in N:
    continue
  else:
    print("No")
    break
else:
  print("Yes")

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

Solution (Python):
import re

A, B = map(int, input().split())
S = input()
pattern = re.compile("^[0-9]{%d}-[0-9]{%d}$" % (A, B))
print("Yes" if pattern.match(S) else "No")

Solution (Python):
import re
a,b=map(int,input().split())
s=input()
if re.search(r"^([0-9])*$",s[:a]) and s[a]=="-" and re.search(r"^([0-9])*$",s[a+1:]) and len(s)==a+b+1:
    print("Yes")
else:
    print("No")

Solution (Python):
A, B = map(int, input().split())
S = input()
check = [i for i in range(10)]
ans = 0

for i in range(A + B + 1):
    if i != A:
        if S[i] == '-':
            print('No')
            ans = 1
            break
        elif int(S[i]) not in check:
            print('No')
            ans = 1
            break
    else:
        if S[i] != '-':
            print('No')
            ans = 1
            break

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

Solution (Python):



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

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

Solution (Python):
a,b = map(int,input().split())
s = input()
t = s[:a] + s[a+1:]

bl = (s[a] == '-') and (t.find('-') == -1)
answer = 'Yes' if bl else 'No'
print(answer)

Solution (Python):
a,b = map(int,input().split())
s = list(str(input()))
hi = s.pop(a)
if hi != "-":
    print("No")
    exit()
if all([i.isdecimal() for i in s]):
    print("Yes")
else:print("No")

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

if len(S) != A+B+1:
    print("No")
    exit()

for i,s in enumerate(S):
    if i == A:
        if s != "-":
            print("No")
            exit()
    else:
        if not "0" <= s <= "9":
            print("No")
            exit()

print("Yes")

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

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

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

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

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

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

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

for i in range(a):
    if s[i] == '-':
        ans = 'No'

if s[a] != '-':
    ans = 'No'

for i in range(a+1,a+b+1):
    if s[i] == '-':
        ans = 'No'

print(ans)

Solution (Python):
nums = list(map(str, range(10)))
a, b = map(int, input().split())
s = input()
cnt = 0
for i in range(a):
    if s[i] in nums:
        cnt+=1
if s[a] == "-":
    cnt += 1
for i in range(a+1,a+b+1):
    if s[i] in nums:
        cnt += 1

print("Yes") if cnt == a+b+1 else print("No")

Solution (Python):
a, b = map(int,input().split())
s = input()
l = [False]*a
l1 = [False]*b
l2 = ["1","2","3","4","5","6","7","8","9","0"]
s1 = s[:a]
s2 = s[a+1:]
for k,i in enumerate(s1):
  if i in l2:
    l[k] = True
for k, i in enumerate(s2):
  if i in l2:
    l1[k] = True
if all(l) and all(l1) and s[a] == "-":
  print("Yes")
else:
  print("No")

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

if s.count("-")>1:
    print("No")
    exit()

if s[a+1]=="-":
    print("Yes")

else:
    print("No")

Solution (Python):

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

S = input()

num = "0123456789"

ans = "Yes"

if len(S) != A+B+1:
    ans = "No"

for i in range(len(S)):

    if i != A and S[i] not in num:
        ans = "No"

    if i == A and S[i] != "-":
        ans = "No"

print (ans)

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):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()


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

tokens = S.split('-')
if len(tokens) == 2 and len(tokens[0]) == A and len(tokens[1]) == B:
    print('Yes')
else:
    print('No')

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

Solution (Python):
import re
a, b = input().split()
post = input()
pattern=r"\d{" + a + r"}-\d{" + b + r"}"
print('Yes' if re.match(pattern, post) else 'No')

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

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

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

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

for i in range(len(S)):

    if i==A:
        if S[i]!="-":
            print("No")
            exit()
    else:
        if not ord('0')<=ord(str(S[i]))<=ord('9'):
            print("No")
            exit()
print("Yes")

Solution (Python):
a, b = map(int,input().split())
s = input()
for c in range(len(s)):
  if c < a:
    if s[c] != '-':
      continue
    else:
      break
  elif c == a:
    if s[c] == '-':
      continue
    else: break
  elif c < a+b+1:
    if s[c] != '-':
      continue
    else: break
  else:break
else:
  print('Yes')
  exit(0)
print('No')

Solution (Python):
d = '0123456789'
A,B = map(int, input().split())
S = input()
if S[A] != '-' or len(S) != A+B+1:
  print('No')
else:
  for i in S[:A]:
    if i not in d:
      print('No')
      exit()
  for i in S[A+1:]:
    if i not in d:
      print('No')
      exit()
  print('Yes')

Solution (Python):
p=input().split()
A=int(p[0])
B=int(p[1])
S=input()
if S[A]=="-":
    t=S.split('-')
    if len(t)==2:
      print("Yes")
    else:
         print("No")
else:
     print("No")

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

Solution (Python):
def abc():
    import re
    a, b = input().rstrip().split()
    s = input().rstrip()
    post_regex = re.compile(r'\d{%s}-\d{%s}' % (a, b))
    print('Yes' if re.match(post_regex, s) else 'No')


abc()

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def is_all_num(test):
    for c in test:
        if c not in "0123456789":
            return False
    return True

def solve(A: int, B: int, S: str):
    if S[A] == "-" and is_all_num(S[0:A]) and is_all_num(S[A+1:]):
        print(YES)
    else:
        print(NO)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    S = next(tokens)  
    solve(A, B, S)

if __name__ == '__main__':
    main()

Solution (Python):
A,B=map(int,input().split())
try:
  C,D=input().split("-")
  if len(C)==A and len(D)==B:
    print("Yes")
  else:
    print("No")
except:
  print("No")

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

A, B = list(map(int, sys.stdin.readline().split()))
S = sys.stdin.readline().rstrip()

ok = True
ok &= len(S) == A + B + 1
ok &= S[A] == '-'
ok &= bool(re.match('^[0-9]*$', S[:A] + S[A + 1:]))
if ok:
    print('Yes')
else:
    print('No')

Solution (Python):

import time
import re
import math

def main():
    A,B=map(int,input().split())
    S=input()
    f=1
    if S.count("-")==1:
        if S.index("-")!=A:
            f=0
    else:
        f=0
    if(f==1):print("Yes")
    else:print("No")
main()

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

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

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

Solution (Python):
import re

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

if len(S)==A+B+1:
    for i in range(A):
        if not('0'<=S[i]<='9'):
            print('No')
            exit()
    if S[A]!='-':
        print('No')
        exit()
    for j in range(B):
        if not('0'<=S[A+1+j]<='9'):
            print('No')
            exit()
    print('Yes')
    exit()
print('No')

Solution (Python):
a,b = map(int,input().split())
s = input()
t = s[:a] + s[a+1:]

bl = (s[a] == '-') and (t.find('-') == -1)
answer = 'Yes' if bl else 'No'
print(answer)

Solution (Python):
import sys
a,b = map(int, input().split())
ad = list(input())

if ad.pop(a)=="-":
    try:
        int("".join(ad))
        print("Yes")
    except: print("No")
else: print("No")

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

if ad.pop(a)=="-":
    try:
        int("".join(ad))
        print("Yes")
    except: print("No")
else: print("No")

Solution (Python):



































a, b = map(int, input().split())
s = list(input())
no = 0
if s[a] != "-":
    print("No")
    no = 1
else:
    for i in s[:a] + s[a + 1::]:
        if not ("0" <= i <= "9"):
            print("No")
            no = 1
            break
if not no:
    print("Yes")

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

Solution (Python):
import sys
A, B = map(int, input().split())
S = input()
ls = [str(i) for i in range(10)]
for i, x in enumerate(S):
    if i == A:
        if x != '-':
            print('No')
            sys.exit()
    else:
        if not x in ls:
            print('No')
            sys.exit()
print('Yes')

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

Solution (Python):
a,b = map(int,input().split())
s = input()
Num = [str(i) for i in range(10)]

flag = True

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

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

Solution (Python):
a,b = map(int,input().split())
n = [str(i) for i in input()]

flg ="Yes"

if n[a] != "-":
    flg ="No"

ls = [str(x) for x in range(10)]
s = set(ls)

if  (set(n[0:a]) | set(n[a+1:a+b+2])) <=s:
    pass
else:
    flg = "No"

print(flg)

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

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

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

if S[a] == "-":
  if S[0:a].isdecimal() and S[a+1:].isdecimal():
    print("Yes")
    exit()
print("No")

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

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

Solution (Python):


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

s = input()

a1 = s[:a]
s1 = s[a]
b1 = s[a+1:]

if a1.isdecimal() and s1 == '-' and b1.isdecimal():
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
import math


def main():
    a, b = map(int, input().split())
    data = input().split('-')
    if len(data) == 2:
        if len(data[0]) == a and len(data[1]) == b:
            print('Yes')
        else:
            print('No')
    else:
        print('No')


if __name__ == '__main__':
    main()

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

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

number = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
flag = True
for i in range(A+B+1):
    if i == A:
        if S[i] != '-':
            flag = False
    else:
        if S[i] in number:
            pass
        else:
            flag = False

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

Solution (Python):
A, B = map(int, input().split())
S = input()
a = ''
b = ''
cnt = 0
for i in range(0, len(S)):
	if S[i] == '-':
		cnt += 1
	elif cnt == 0:
		a = a + S[i]
	else: b = b + S[i]
if cnt == 1 and len(a) == A and len(b) == B:
	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()
print("Yes" if s[a]=="-" and s.count("-")==1 else "No")

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

if len(s) == a+b+1 and s[a] == "-":
    x = s[:a]
    y = s[a+1:]
    for i in x:
        if i not in ans:
            print("No")
            break
    else:
        for j in y:
            if j not in ans:
                print("No")
                break
        else:
            print("Yes")
else:
    print("No")

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def solve(A: int, B: int, S: str):
    ret = YES
    for i, c in enumerate(S):
        if i == A and c != '-':
            ret = NO
        if i != A and not '0' <= c <= '9':
            ret = NO
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    S = next(tokens)  
    solve(A, B, S)

if __name__ == '__main__':
    main()

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

if len(s)!=a+b+1:
  print('No')
  exit()
if '-' in s[0:a]:
  print('No')
  exit()
if s[a]!='-':
  print('No')
  exit()
if '-' in s[a+1:]:
  print('No')
  exit()
print('Yes')

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

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

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

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

Solution (Python):
A, B = [int(i) for i in 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()
 
print("Yes" if s[a]=="-" and s.count("-")==1 else "No")

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

x=input()

x1=x[:a]
x2=x[a]
x3=x[a+1:a+b+1]





if x2=="-" and  (all(x1[i] in ["0","1","2","3","4","5","6","7","8","9"] for i in range(a))) and (all(x3[j] in ["0","1","2","3","4","5","6","7","8","9"]   for j in range(b))):
    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 = [ int(v) for v in input().split() ]
s = input()
if s[a] == "-" and s[:a].count("-") == 0 and  s[a+1:].count("-") == 0:
  print("Yes")
else:
  print("No")

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

for i in s:
    if i == '-':
        continue
    elif int(i)>= 0 and int(i)<= 9:
        num += 1
    
    

if a + b == num and s[a] == '-':
    print('Yes')
else:
    print('No')

Solution (Python):
a, b = map(int, input().split())
s = list(str(input()))
if s[a] == "-":
    del s[a]
    if "-" in s:
        print("No")
    else:
        print("Yes")
else:
    print("No")

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

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

s = list(input())

ans = 'Yes'
for i in range(len(s)):
    if i == a:
        if s[i] != '-':
            ans = "No"
            break
    else:
        if s[i] not in "0123456789":
            ans = "No"
            break

print(ans)

Solution (Python):
a,b = map(int, input().split())
s = input()
f = True
for i in range(len(s)):
    if i == a:
        continue
    if s[i] > "9" or s[i] < "0":
        f=False

if s[a] != "-":
    f= False

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

Solution (Python):
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[:A].isdecimal() != True:
    flag = False
elif S[A:A+1] != "-":
    flag = False
elif S[A+1:].isdecimal() != True:
    flag = False

if flag:
    print("Yes")
else:
    print("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] < '0' or S[i] > '9':
            flag = False
            break
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    A, B = (int(_) for _ in input().split())
    S = input()
    if S.count('-') != 1:
        print('No')
        return
    before_str, after_str = S.split('-')
    if len(before_str) == A and len(after_str)  ==B:
        print('Yes')
    else:
        print('No')
        
if __name__ == '__main__':
    main()

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

if len(S) != A+B+1:
    print("No")
else:
    for i in range(A):
        if S[i] == "-":
            print("No")
            break
        else:
            c += 1

if c == A:
    if S[A] != "-":
        print("No")
        c += 1
    else:
        for j in range(A+1,A+B+1):
            if S[j] == "-":
                print("No")
                c += 1
                break

if c == A:
    print("Yes")

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

Solution (Python):
import re
A,b = map(int,input().split())
S = input()
ok = True
for i in range(len(S)):
    if i == A:
        if S[i] == "-":
            pass
        else:
            ok = False 
    else:
        if re.match("\d",S[i]):
            pass
        else:
            ok = False
if ok:
    print("Yes")
else:
    print("No")

Solution (Python):
A,_ = input().split()
S = input()
flag = (S.count('-') == 1) and (S.find('-') == int(A))
print('Yes' if flag else 'No')

Solution (Python):

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


if S[A]!='-':
  print('No')
  exit()
else:
  for x in S[:A]:
    
    if x not in '0123456789':
      print('No')
      exit()
  
  for x in S[A+2:]:
    
    if x not in '0123456789':
      print('No')
      exit()


print('Yes')

Solution (Python):

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


if S[A]!='-':
  print('No')
  exit()
else:
  for x in S[:A]:
    if x not in '0123456789':
      print('No')
      exit()
  for x in S[A+2:]:
    if x not in '0123456789':
      print('No')
      exit()


print('Yes')

Solution (Python):
A, B = map(int,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()
pos = S.split('-')
if len(pos[0]) == A and len(pos[1]) == B and len(pos) == 2:
    print("Yes")
else:
    print("No")

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

p=s[:a]
q=s[a+1:]

if s[a]=="-" and p.isdecimal() and q.isdecimal():
    print("Yes")
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()
number = ('0','1','2','3','4','5','6','7','8','9')
if s[a] != '-':
        print('No')
        exit()
for i in range(a + b + 1):
        if i == a:
                i += 1
        if s[i] not in number:
                print('No')
                exit()
print('Yes')

Solution (Python):

A,B =map(int,input().split())
hih=0
num=1
test=1
S=str(input())
S= list(S)
for s in S:
    if num==A+1 and s=="-":
        hih=1
    if num!=A+1 and s=="-":
        test=0
        
    
    num+=1
if hih==1 and test==1:
    print("Yes")
else:
    print("No")

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

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

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

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

print("Yes" if len(s) == a + b + 1 
            and s[a] == "-" 
            and s.count("-") == 1
            
			else "No")

Solution (Python):
import re
a, b = map(str, input().split())
s = input()
print('Yes' if re.match('\d{'+a+'}-\d{'+b+'}', s) else 'No')

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

flag = True

if (S[A]!="-"):
    flag = False
if (not S[:A].isdigit()):
    flag = False
if (not S[A+1:A+B+1].isdigit()):
    flag = False

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

Solution (Python):

k = input().split()

s = input()

a = int(k[0])
b =int(k[1])

j = 1
for t in range(a+b+1):
    if t!=a:
        try:
            if int(s[t]) >= 0 and int(s[t]) <= 9:
                pass
            else:
                j = 0
                
        except:
            j = 0
    else:
        if s[t] != "-":
            j =0
if j:
    print("Yes")
else:
    print("No")

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    m = II()
    print(48-m)
    return


def B():
    a, b = LI()
    s = S()
    ans = list(map(str, range(10)))
    for num, si in enumerate(s):
        if num != a:
            if si in ans:
                continue
            print("No")
            return
        else:
            if si == "-":
                continue
            print("No")
            return
    print("Yes")
    return


def C():
    return


def D():
    a = II()
    ans = inf
    b = 0
    for k in range(1, 10 ** 5):
        b += a
        ans = min(ans, sum(list(map(int, list(str(b))))))
    print(ans)
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    B()

Solution (Python):

import math

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

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

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

Solution (Python):
A,B=map(int,input().split())
S=input()
flag=True
for i in range(A):
    if S[i] not in '0123456789':
        flag=False
        break
if S[A]!='-':
    flag=False
for i in range(B):
    if S[i+A+1] not in '0123456789':
        flag=False
        break
if flag:print('Yes')
else:
    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()
moji = [str(i) for i in range(0,10)]
ans = 'Yes'
if len(s) != a+b+1:
    ans = 'No'
for i in range(len(s)):
    if i == a:
        if s[i] != '-':
            ans = 'No'
    else:
        if s[i] not in moji:
            ans = 'No'
print(ans)

Solution (Python):


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

    for i in range(len(S)):
        if i == A:
            if S[A] == "-":
                continue
            print("No")
            return 
        try:
            int(S[i])
        except:
            print("No")
            return
    print("Yes")

if __name__ == "__main__":
    solve()

Solution (Python):
A,B=map(int,input().split())
s=input()
S=s.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().split('-')
if len(s)!=2:
    print('No')
else:
    print('Yes' if len(s[0])==a and len(s[1])==b else 'No')

Solution (Python):
def ipt(N=0,switch=0):
    if N == 0:
        return list(map(int,input().split()))
    else:
        if switch==0:
            return [list(map(int,input().split())) for _ in range(N)]
        else:
            return [int(input()) for _ in range(N)]

a,b=ipt()
s=input()

flag=0
for i in range(a):
    if s[i] == "-":
        flag=1
        break

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

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

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

Solution (Python):
a,b = list(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()
print("Yes" if s[a]=="-" and s.count("-")==1 else "No")

Solution (Python):
import re
a,b=input().split()
r=re.match(r'\d{'+ a +r'}-\d{'+b+r'}$',input())
print('Yes' if r else 'No')

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

num=set('1234567890')
if set(s[:a])<num and s[a]=='-' and set(s[a+1:])<num:
  print('Yes')
else:
  print('No')

Solution (Python):
a, b = (int(i) for i in input().split())  
x = input()
if all([x[:a].isdecimal(),x[-b:].isdecimal(),x[a:a+1]=="-"]):
  print("Yes")
else:
  print("No")

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