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):
import re
A, B = map(int, input().split())
S = input()

ans = 'No'
p = '\d{' + str(A) + '}-\d{' + str(B) + '}'
if re.match(p, S):
    ans = 'Yes'
print(ans)

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

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

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

else:
    print("No")

Solution (Python):
import re

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

former = S[0:A]
later = S[(A+1):(A+B+3)]

r_f = re.compile('\d{' + str(A) + '}')
r_l = re.compile('\d{' + str(B) + '}')

if r_f.findall(former) and r_l.findall(later) and S[A] == '-':
  print('Yes')
else:
  print('No')

Solution (Python):
import re


def answer(a: int, b: int, s: str) -> str:
    pattern = fr'\d{{{a}}}-\d{{{b}}}'
    if re.match(pattern, s):
        return 'Yes'
    return 'No'


def main():
    a, b = map(int, input().split())
    s = input()
    print(answer(a, b, s))


if __name__ == '__main__':
    main()

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

Solution (Python):
A, B = map(int, input().split())
S = input()
s = S.split("-")
ans = "No"
if len(s) == 2 and len(s[0]) == A and len(s[1]) == B:
    t = "".join(s)
    if all([v in "0123456789" for v in t]):
        ans = "Yes"
print(ans)

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

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

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

ans = True

for (i, char) in enumerate(s):
    if i == a:
        if char == '-':
            ans = True
        else:
            ans = False
            break
    else:
        try:
            ans = type(int(char)) is int
        except:
            ans = False
            break

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

Solution (Python):
a,b = map(int, input().split())
s = input()
count = 0
ans = 'Yes'
for i in range(a+b+1):
  if i == a:
    if s[i] != '-':
      ans = 'No'
      break
  else:
    if s[i] == '-':
      ans = 'No'
      break
print(ans)

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

num = '0123456789'

if all(s[i] in num for i in range(a)) and s[a] == '-' and all(s[-(i+1)] in num for i in range(b)):
    print('Yes')
else:
    print('No')

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

Solution (Python):
lst = input().split()
A = int(lst[0])
B = int(lst[1])
s = input()

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

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

if S.find("-") == S.rfind("-") == A:
  print("Yes")
else:
  print("No")

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

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

for i in range(a):
	if is_int(s[i]) == True:
		c += 1
for i in range(a+1,a+b):
	if is_int(s[i]) == True:
		c += 1
if s[a] == '-' and c == len(s) - 2:
	print('Yes')
else:
	print('No')

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

S=input()
d=0
c=a+b+3
for i in range(a+b+1):
	if S[i]=='-':
		c=i+1
		d+=1

if c==a+1 and d==1:
	print('Yes')
else:
	print('No')

Solution (Python):
A, B = map(int, input().split())
S = input()
D = [ str(i) for i in range(10)]
T = S[:A] + S[A+1:]

if S[A] == "-" and all( t in D for t in T):
  print("Yes")
else:
  print("No")

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

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

Solution (Python):
a,b = map(int,input().split())
s = input()
if len(s) == a + b + 1:
    if s[a] == "-":
        s = s.replace("-","")
        if s.isdecimal() and len(s) == a + b:
            print("Yes")
        else:
            print("No")
    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] == "-" and s[a+1:].isdecimal() else "No")

Solution (Python):
a,b=map(int,input().split())
s=list(input())
if s[a]=='-':
    c=0
    for i in range(0,a+b+1):
        if s[i].isdecimal()==True:
            c=c+1
    if c==a+b:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(A: int, B: int, S: str):
    if len(S) != A + B + 1:
        print(NO)
        return
    an = S[0:A]
    h = S[A]
    bn = S[A+1:]
    if not an.isdecimal():
        print(NO)
        return
    if h != "-":
        print(NO)
        return
    if not bn.isdecimal():
        print(NO)
        return
    print(YES)

    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 s.count('-') == 1 and s[a] =='-':
    print('Yes')
else:
    print('No')

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

if len(s) == a + b + 1:
	if s[a] == "-":
		del s[a]
		try:
			if all([0 <= int(x) <= 9 for x in s]):
				print("Yes")
			else:
				print("No")
		except:
			print("No")
	else:
		print("No")
else:
	print("No")

Solution (Python):

import sys
sys.setrecursionlimit(10**6)

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

x = s.split("-")

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

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

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

Solution (Python):
import math

is_no = 0
num1, num2 = map(int, input().split())
str1 = input()
table = list(str1)
count = 0
for i in range(len(str1)):
    if table[i] == '-':
        count += 1
    else:
        continue
if count == 1 and table[num1] =='-':
    print('Yes')
else:
    print('No')

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

if "-" in s[:a] or "-" in s[-b:] or s[a]!="-":
    print("No")
else:
    print("Yes")

Solution (Python):
a,b=map(int,input().split())
S=input()
for i in range(len(S)):
  if i==a:
    if S[i]!="-":
      print("No")
      break
  else:
    try:
      Si = int(S[i])
    except:
      print("No")
      break
else:
  print("Yes")

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

result = 'Yes'
if '-' in S[:A]:
    result = 'No'
if '-' not in S[A]:
    result = 'No'
if '-' in S[A+1:]:
    result = 'No'

print(result)

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

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

Solution (Python):
import re
A, B = map(int, input().split())
S = input()
pattern = re.compile('[0-9]'*A + '-' +'[0-9]'*B)
print('Yes' if pattern.fullmatch(S) != None else 'No')

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

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


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

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

Solution (Python):

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

ans = 'Yes'
if S[A] != '-':
    ans = 'No'
else:
    S = S.replace('-', '', 1)
    if S.isdecimal() == False:
        ans = 'No'

print(ans)

Solution (Python):
import sys
A, B = [int(x) for x in input().split()]
S = list(input())
for i in range(A+B+1):
  if(i==A):
    if(S[i]!='-'):
      print('No')
      sys.exit()
  else:
    if(str.isdecimal(S[i])==False):
      print('No')
      sys.exit()
print('Yes')

Solution (Python):
a,b = map(int, input().split())
s = input()
for i in s[0:a]:
    if 48 <= ord(i) and ord(i) <= 57:
        continue
    else:
        print("No")
        exit()
if s[a] != "-":
    print("No")
    exit()
for i in s[a+1:a+b+1]:
    if 48 <= ord(i) and ord(i) <= 57:
        continue
    else:
        print("No")
        exit()
print("Yes")

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()

if s[a] == "-" and len(s) == a + b + 1 and "-" not in s[:a] and "-" not in s[a+1:]:
  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):
def main():
    A, B = map(int, input().split())
    S = input()
    cond = [
        len(S) == A + B + 1,
        S[A] == '-',
        S[:A].isdigit(),
        S[A + 1:].isdigit()
    ]
    print('Yes' if all(cond) else 'No')


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import copy
import math
import itertools
import numpy as np

l = [int(c) for c in input().split()]
A=l[0]
B=l[1]
S=input()

if S[A] == "-" and str.isdecimal(S[0:A]+S[A+1:A+B]):
    print("Yes")
else:
    print("No")

Solution (Python):
import sys


def LI():
    return list(map(int, input().split()))


A, B = LI()
S = input()
ans = "Yes"
for i in range(A):
    if S[i] == "-":
        ans = "No"
        break
if S[A] != "-":
    ans = "No"
for i in range(A+1, A+B+1):
    if S[i] == "-":
        ans = "No"
        break
print(ans)

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

if len(s.split('-')) == 2 and s[a] == '-':
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())  


A,B = MI()
S = LS2()

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

def is_num(x):
    if '0' <= x <= '9':
        return True
    return False
def err():
    print('No')
    quit()

a,b = inpl()
s = input()
for i,x in enumerate(s):
    if i == a:
        if x != '-':
            err()
    else:
        if not is_num(x):
            err()
print('Yes')

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

okFlag = True
for key,val in enumerate(S):
    if key == A:
        if S[key] != '-':
            okFlag = False
        else:
            continue
    elif S[key] not in check:
        okFlag = False

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

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

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

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

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

Solution (Python):
A,B = map(int,input().split())
S = str(input())
for i in range(len(S)):
  if i < A:
    if not S[i].isnumeric():
      print("No")
      exit()
  elif i == A:
    if S[i] != "-":
      print("No")
      exit()
  else:
    if not S[i].isnumeric():
      print("No")
      exit()
print("Yes")

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  


A,B = MI()
S = LS2()

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

Solution (Python):
A,B = map(int,input().split())
L = ['0','1','2','3','4','5','6','7','8','9']
s = str(input())
for i in range(len(s)):
  if i == A:
    if s[A] != '-':
      print('No')
      exit()
  else:
    b = s[i]
    if b not in L:
      print('No')
      exit()
print('Yes')

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

Solution (Python):
a, b = list(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):
def main():
    a, b = map(int, input().split())
    s = input()
    all_l = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
    hyphen = ['-']

    answer = 'Yes'
    for i in range(len(s)):
        if i == a:
            if s[i] not in hyphen:
                answer = 'No'
        else:
            if s[i] not in all_l:
                answer = 'No'

    print(answer)


if __name__ == "__main__":
    main()

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

check = False
if len(S) == 2:
  s,t = S[0],S[1]
  if A == len(s) and B == len(t):
    check = True

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

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

A = s[:a]
con = s[a]
B = s[-b:]

flg = True
num = [str(x) for x in range(10)]
num = set(num)

for x in A:
    if x not in num:
        flg = False

for x in B:
    if x not in num:
        flg = False

if con != "-":
    flg = False

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

Solution (Python):
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())  


A,B = MI()
S = LS2()
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):
li = ["0","1","2","3","4","5","6","7","8","9"]
a,b = map(int,input().split())
s = input()
for i in range(a+b):
    if i != a:
        if s[i] not in li:
            print("No")
            exit()
    else:
        if s[i] != "-":
            print("No")
            exit()
print("Yes")

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

import string

for v in S[:A]:
    if v not in string.digits:
        print('No')
        sys.exit(0)
if S[A] != '-':
    print('No')
    sys.exit(0)
for v in S[A+1:]:
    if v not in string.digits:
        print('No')
        sys.exit(0)
print('Yes')

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

Solution (Python):
import re
A, B = map(int, input().split())
S = input()
n_pattern = "[0-9]"
res  = "Yes"
for i in range(A+B+1):
  if i < A:
    if re.match(n_pattern, S[i]) is None:
      res = "No"
      break
  elif i == A:
    if S[i] != "-":
      res = "No"
      break
  else:
    if re.match(n_pattern, S[i]) is None:
      res = "No"
      break
  
print(res)

Solution (Python):
a, b = map(int, input().split())
s = list(input())
def f():
    for i in range(len(s)):
        if i == a:
            if s[i] != "-":
                return "No"
        else:
            if s[i] == "-":
                return "No"
    return "Yes"
print(f())

Solution (Python):
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")
                exit()
        else:
            if not "0" <= s[i] <= "9":
                print("No")
                exit()
    else:
        print("Yes")


if __name__ == "__main__":
    main()

Solution (Python):
import sys
import copy
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

if len(s) == 2 and len(s[0]) == a and len(s[1]) == b:
    print('Yes')
    sys.exit()
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 = list(map(int,input().split()))
s =input()
for i in range(a+b+1):
    if i == a:
        if s[i] !='-':
            print('No')
            break
    else:
        if s[i]=='-':
            print("No")
            break
            
        else:
            if int(s[i])<0 or 9<int(s[i]):
                print("No")
                break
else:
    print('Yes')

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

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

Solution (Python):
a,b=map(int,input().split())
n = input()
if n[0:a].isdecimal() and n[a]=="-" and n[a+1:a+b+1].isdecimal():
  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')
        exit(0)
    elif i == A and S[i] != '-':
        print('No')
        exit(0)
    elif i > A and S[i] == '-':
        print('No')
        exit(0)
print('Yes')

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

flag = False
if S[A] == '-':
    S_ = S.split('-')
    if len(S_) == 2:
        if len(S_[0]) == A and len(S_[1]) == B:
            if S_[0].isdigit() and S_[1].isdigit():
                flag = True

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

Solution (Python):

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

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

num = list(map(str,list(range(10))))

flag = True
for i in range(a):
    if s[i] not in num:
        flag = False
if s[a] != "-":
    flag = False
for i in range(a+1,a+b+1):
    if s[i] not in num:
        flag = False

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

Solution (Python):
a,b = map(int,input().split())
n = input()
if 1<=a<=5 and 1<=b<=5:
  if n[a]=="-":
    if n[0:a].isdecimal() and n[a+1:a+b+1].isdecimal():
      print("Yes")
      exit()
print("No")

Solution (Python):

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

Solution (Python):
a, b = map(int, input().split())
s = input()
ans = True
for i in range(a + b + 1):
    if s[a] != "-":
        ans = False
        break
    else:
        if i == a:
            pass
        else:
            for j in range(10):
                if s[i] == str(j):
                    break
            else:
                ans = False

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    A, B = map(int, readline().split())
    s = input()
    nums = "0123456789"

    def judge():
        if s.count("-") == 1:
            if s[A] == "-":
                first, second = s.split("-")
                for c in first:
                    if c not in nums:
                        return False
                for c in second:
                    if c not in nums:
                        return False
                return True
        return False

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


if __name__ == '__main__':
    main()

Solution (Python):

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

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

for i in range(A+B+1):

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

Solution (Python):
dg = "0123456789"

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

postcode = True
for i, ch in enumerate(S):
  if i == A:
    if ch != "-":
      postcode = False
      break
  else:
    if ch not in dg:
      postcode = False
      break
      
if postcode:
  print("Yes")
else:
  print("No")

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

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

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

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

if s[a]=='-' and '-' not in t:
	print("Yes")
else:
	print("No")

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

if s[a]=='-' and '-' not in t:
	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()

if ("-" not in s[:a])&("-" not in s[a+1:])&(s[a]=="-"):
    print("Yes")
else:
    print("No")

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

for i in S:
    if i == '-':
        cnt += 1

if cnt == 1:
    post = S.split('-')
    if len(post[0]) == A and len(post[1]) == B:
        print('Yes')
        exit()

print('No')

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

for i in S:
    if i == '-':
        cnt += 1

if cnt == 1:
    post = S.split('-')
    if len(post[0]) == A and len(post[1]) == B:
        print('Yes')
        exit()

print('No')

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

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

Solution (Python):
import re
A,B = input().split()
S = input()

my_regex = r"\d{" + A + r"}-\d{"+ B +r"}"

if re.fullmatch(my_regex, S) == None:
  print('No')
  
else:
  print('Yes')

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

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

print("Yes")

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

if s.count('-') == 1:
     ind = s.index('-')
     alen = ind
     blen = len(s)-(ind+1)

     if alen == a and blen == b:
         ans = 'Yes'

print(ans)

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

s1 = s[:a]
s2 = s[a:a+1]
s3 = s[a+1:]

if s2 == '-':
    if str.isdigit(s1) and len(s1) == a and str.isdigit(s3):
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

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

ok = True
ok = ok and  s[0:a].isdecimal()
ok = ok and s[a] == '-'
ok = ok and s[a+1:].isdecimal()

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

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

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

Solution (Python):
import re
A, B = (int(x) for x in input().split())
S = input()
match = '\d' * A + '-' + '\d' * B 
ptn = re.compile(match)
print('Yes' if ptn.search(S) != None 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()
if b == 1:
  print("Yes" if s[0:a].isdecimal() and s[a] == "-" and s[-1].isdecimal() else "No")
else:
  print("Yes" if s[0:a].isdecimal() and s[a] == "-" and s[a+1:].isdecimal() and s[-b-1] == "-" else "No")

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

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

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

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

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

Solution (Python):
A, B = map(int, input().split())
S = list(input())
x = len(S)
if len(S) != A + B + 1:
  print('No')
if S[A] == '-' :
  if S.count('-') == 1:
  
    print('Yes')
  else:
    print('No')
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):
import re
A,B=map(int,input().split())
S=input()

m = re.match(r'^(\d+)\-(\d+)$', S)

if m:
    if len(m.groups()[0]) == A and len(m.groups()[1]) == B:
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

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

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

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

if s[a] != '-':
  ans = 'No'
else:
  cnt = s.count('-')
  if cnt > 1:
    ans = 'No'
  else:
    ans = 'Yes'
    
print(ans)

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

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

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