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) != 2:
    print("No")
    
elif len(s[0])==a and len(s[1]) == b:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
def main():
    A, B = map(int, input().split())
    S = str(input())
    f = 0
    
    for i in range(A):
        if S[i].isnumeric():
            continue
        else:
            print('No')
            return
    
    if S[A] != '-':
        print('No')
        return
    
    for i in range(A+1, A+B+1):
        if S[i].isnumeric():
            continue
        else:
            print('No')
            return
    print('Yes')
    
main()

Solution (Python):
x,y=map(int,input().split())
s=input()
d=s.count('-')
if('-' in s):
    f=s.index('-')
if(d==1 and f==x):
    print("Yes")
else:
    print("No")

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

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

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

print("Yes")

Solution (Python):
A,B=map(int,input().split())
S=list(input())
a=[]
for i in range(len(S)):
    if 0<=i and i<=A-1:
        if S[i].isdecimal()==True:
            a.append('Yes')
        else:
            a.append('No')
    elif i==A:
        if S[i]=='-':
            a.append('Yes')
        else:
            a.append('No')
    elif i>A: 
        if S[i].isdecimal()==True:
            a.append('Yes')
        else:
            a.append('No')
if 'No' in a:
    print('No')
else:
    print('Yes')

Solution (Python):
A,B = map(int,input().split())
S = list(input())
if len(S) != A+B+1:
    print('No')
    exit()
for i,s in enumerate(S):
    if i!=A and s != '-':
        continue
    if i==A and s == '-':
        continue
    print('No')
    exit()
print('Yes')

Solution (Python):
a, b = map(int, input().split())
s = input()
cnt = 0
y = ['0','1','2','3','4','5','6','7','8','9']

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

Solution (Python):


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

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

for i in range(a):
    if s[i] not in num:
        print("No")
        exit()
if s[a] != "-":
    print("No")
    exit()
for i in range(b):
    if s[(-1) * i] not in num:
        print("No")
        exit()

print("Yes")

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

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

for i in range(A):
    if S[i].isdecimal():
        pass
    else:
        print("No")
        exit()

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

for i in range(A + 1, A + B + 1):
    if S[i].isdecimal():
        pass
    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 = list(input())
S_h = S.pop(A)

NUM = [str(i) for i in range(10)]
isCorrect = True

if S_h != '-':
    isCorrect = False

for i in S:
    flag = 0
    for j in NUM:
        if i==j:
            flag = 1
    if flag == 0:
        isCorrect = False

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

Solution (Python):


def main():
    A, B = map(int, input().split())
    s = input()
    numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
    flag = True
    if len(s) == A + B + 1:
        if s[A] != '-':
            flag = False
        for a in s[:A]:
            if a not in numbers:
                flag = False
        for b in s[A+1:]:
            if b not in numbers:
                flag = False
    else:
        flag = False
    
    if flag:
        print("Yes")
    else:
        print("No")
        

if __name__ == "__main__":
    main()

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

Solution (Python):
def resolve():
    '''
    code here
    '''
    A, B = [int(item) for item in input().split()]
    S = input()

    if S[A] == '-' and len(S) >= 3:
        if '-' in S[:A] or '-' in S[-1*B:]:
            print('No')
        else:
            print('Yes')
    else:
        print('No')
if __name__ == "__main__":
    resolve()

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()
s = S.replace('-', '')

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

Solution (Python):

def resolve():
    import sys
    input = sys.stdin.readline
    
    

    a, b = [int(x) for x in input().rstrip().split(" ")]
    s = input().rstrip()

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




if __name__ == "__main__":
    resolve()

Solution (Python):
import re
n=input();print('YNeos'[not re.match(r'[0-9]{'+n[0]+'}-[0-9]{'+n[-1]+'}',input())::2])

Solution (Python):
import re
n=[*input()];print('YNeos'[not re.match(r'[0-9]{'+n[0]+'}-[0-9]{'+n[-1]+'}',input())::2])

Solution (Python):
import re
n,m=input().split();print('YNeos'[not re.match(r'[0-9]{'+n+'}-[0-9]{'+m+'}',input())::2])

Solution (Python):
import re
n,m=input().split();print('YNeos'[re.match(r'[0-9]{'+n+'}-[0-9]{'+m+'}',input()) is None::2])

Solution (Python):
import re
n,m=input().split();print('YNeos'[re.match(r'[0-9]{'+n+'}-[0-9]{'+m+'}',input())==None::2])

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

if s[a] != '-':
    print('No')
    exit()
try:
    int(s[:a])
    int(s[a + 1:])
except:
    print('No')
    exit()
print('Yes')

Solution (Python):
a,b = map(int,input().split())
s = input()
S = list(s)
c = 0
for i in S:
    if i == "-":
        c += 1
        if c > 1:
            print("No")
            exit()
            
if s.isdecimal() is True:
    print("No")
    exit()
    
if len(s) != a + b + 1:
    print("No")
    exit()
    
if s[:a].isdecimal() is True and S[a] == "-":
    print("Yes")
    
else:
    print("No")

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

for i in range(int(a[0])):
  if b[i] == "-":
    c = 1
  else:
    pass

if b[int(a[0])] != "-":
  c = 1

for i in range(int(a[0]) + 1, int(a[0]) + int(a[1]) + 1):
  if b[i] == "-":
    c = 1
  else:
    pass

if c == 1:
  print("No")
else:
  print("Yes")

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

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

ans = True
for i in range(a+b+1):
    if i==a:
        if s[i]!='-':
            ans = False
    else:
        if s[i]=='-':
            ans = False
if ans:
    print('Yes')
else:
    print('No')

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

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

if s[a] == '-' 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()

count = "No"

if S[:A].isnumeric():
    if S[A] == "-":
        if len(S[A+1:]) == B and S[A+1:].isnumeric():
            count = "Yes"

print(count)

Solution (Python):
a, b = list(map(int, input().split()))
s = input()
flag = True
for i in range(a + b + 1):
    try:
        if i < a or i > a:
            if str(int(s[i])) == s[i]:
                pass
            else:
                flag = False
                break
        else:
            if s[i] == '-':
                pass
            else:
                flag = False
                break
    except:
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

flag = "Yes"
for i in range(A):
    if S[i] not in num:
        flag = "No"

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

for j in range(B):
    if S[j+A+1] not in num:
        flag = "No"

print(flag)

Solution (Python):
A, B = map(int, input().split())
S = str(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 = str(input())
num = ['0','1','2','3','4','5','6','7','8','9']
m = 0
for i in range(a+b+1):
    if i == a:
        if s[i] == '-':
            m += 1
    else:
        for h in num:
            if s[i] == h:
                m += 1
if m == a+b+1:
    print('Yes')
else:
    print('No')

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

Solution (Python):

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

is_A = S[:A]
is_B = S[A+1:A+B+1]
bar = S[A]

if ('-' in is_A) or ('-' in is_B) or bar != '-':
    print('No')
else :
    print('Yes')

Solution (Python):
import string

A,B=list(map(int, input().split()))
S=input()
a=S[:A]
hi=S[A]
b=S[A+1:]
L=string.digits

if all(a[_] in L for _ in range(A)) and \
   all(b[_] in L for _  in range(B)) and \
   hi=='-':
  print('Yes')
else:
  print('No')

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b = rm()
s = rr()
for i in range(a):
    if s[i] not in '0123456789':
        print('No')
        exit()
for i in range(b):
    if s[a+1+i] not in '0123456789':
        print('No')
        exit()
if s[a] != '-':
  print('No')
  exit()
print('Yes')

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

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

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

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

Solution (Python):
import re

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

m = '\d'*A + '-' + '\d'*B

if re.match(m,S):
    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):
        if (s[i] != "-"):
            ans = "No"
            break
    else:
        if (s[i] >= "0" and s[i] <= "9"):
            pass
        else:
            ans = "No"
            break
print(ans)

Solution (Python):
import os
import sys
import math
if os.environ.get("DEBUG") is not None:
    sys.stdin = open("in.txt", "r")
rl = sys.stdin.readline

a, b = map(int, rl().split())
s = rl().rstrip("\n")

failed = False
for i in range(0, a):
    if not 48 <= ord(s[i]) <= 57:
        failed = True
        break
if s[a] != "-":
    failed = True
for i in range(a + 1, len(s)):
    if not 48 <= ord(s[i]) <= 57:
        failed = True
        break
print("No" if failed else "Yes")

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

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

if S[A] == "-" and S[0:A].isdecimal() and S[A+1:A+B+1].isdecimal():
  flag = True

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

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

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

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

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

Solution (Python):

A, B = map(int, input().split())
S = input()
for i in range(len(S)):
    if i<A:
        if S[i].isdigit():
            pass
        else:
            print("No")
            break
    elif i==A:
        if S[i]!="-":
            print("No")
            break
    else:
        if S[i].isdigit():
            pass
        else:
            print("No")
            break
else:
    print("Yes")

Solution (Python):
A, B = map(int, input().split())
S = input().strip()
try:
    if int(S[:A]) >= 0 and int(S[-B:]) >= 0 and S[A] == "-":
        print("Yes")
    else:
        print("No")
except:
    print("No")

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

if len(S) == 2 and len(S[0]) == a:
    print('Yes')
else:
    print('No')

Solution (Python):

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

sa = S[:A]
sb = S[A+1:]

if sa.isdecimal() and sb.isdecimal() and S[A]=="-":
    print("Yes")
else:
    print("No")

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

code = S[:A] + S[-B:]

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

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

Solution (Python):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

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

x = 0
y = 0

try:
    x = int(s[:a])
    y = int(s[a+1:])
except:
    print("No")
    exit()

if s[a] == "-":
    print("Yes")
else:
    print("No")

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

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

if len(S) != A+B+1:
  print(0)
  print('No')
  exit()
  
for i in range(A):
  if S[i] not in set(map(str,list(range(10)))):
    print('No')
    exit()
if S[A] != '-':
  print('No')
  exit()
for i in range(A+1,A+B+1):
  if S[i] not in set(map(str,list(range(10)))):
    print('No')
    exit()
print('Yes')

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

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

for i, c in enumerate(S):
    if i == A:
        if c != '-':
            print('No')
            exit()
    else:
        if c < '0' or '9' < c:
            print('No')
            exit()
print('Yes')

Solution (Python):
A,B= map(int, input().split())
str1 = input()
li = list(str1)
flag = True
flag2 = False
for i in range(len(li)):
    if li[i] == '-' and i != A:
        flag = False
    elif  li[i] == '-':
        flag2 = True
if flag and flag2:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b = list(map(int, input().strip().split()))
s= input().strip()
f="Yes"
if s[a]!='-':
    f="No"

for i in range(a):
    if  s[i]=="-":
        f="No"
        break

for i in range(a+1,a+b+1):
    if  s[i]=="-":
        f="No"
        break
print(f)

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

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

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = map(int, readline().split())
    S = readline().strip()
    
    if S.count('-') != 1:
        print('No')
        return
    
    if S.index('-') == A:
        print('Yes')
    else:
        print('No')
    
    return


if __name__ == '__main__':
    main()

Solution (Python):
a,b=map(int,input().split())
s=input()
n=len(s)
l=list("0123456789")

f=0
for i in range(a):
    if s[i] in l:
        f+=1
    
if s[a]=="-":
    
    f+=1

for i in range(b):
    if s[-1-i] in l:
        f+=1
    
print("Yes" if f==n else "No")

Solution (Python):
a,b = map(int, raw_input().split())
s = raw_input()
def f(s,a):
	for i,l in enumerate(s):
		if i != a and l not in map(str, range(10)): return False
	return True
print 'Yes' if s[a] == '-' and f(s,a) else 'No'

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

for i in range(len(S)):
  if (i == a and S[i] != "-") or (i != a and S[i] =="-"):
    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 str.isdecimal(S[:A]+S[-B:]):
	print("Yes")
else:
	print("No")

Solution (Python):
import re

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

m = re.match("([0-9]+)-([0-9]+)", S)

if m:
    t1 = m[1]
    t2 = m[2]
    if len(t1) == A and t1.isdecimal() and len(t2) == B and t2.isdecimal():
        print("Yes")
        exit()

print("No")

Solution (Python):
import sys

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

for i in range(a + b + 1):
  if i < a and s[i] == '-':
    print('No')
    sys.exit()
  elif i == a and s[i] != '-':
    print('No')
    sys.exit()
  elif i > a + 1 and s[i] == '-':
    print('No')
    sys.exit()
print('Yes')

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

Solution (Python):
f=1
a,b=list(map(int,input().split()))
s=input()
if s[a]!="-":
  f=0

for i in range(a):
  if not s[i] in "1234567890":
    f=0
for i in range(b):
  if not s[i+a+1] in "1234567890":
    f=0
if f:
  print("Yes")
else:
  print("No")

Solution (Python):

















import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

flag = True
for i in range(len(S)):
    if i == A:
        if S[i] != '-':
            flag = False
    else:
        if not S[i].isdigit():
            flag = False
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
import re

A, B = map(int, input().split())
S = input()
print ('Yes' if re.search(r'\A\d{{{}}}-\d{{{}}}\Z'.format(A, B), S) else 'No')

Solution (Python):
a,b=map(int,input().split())
s=input()
li=[str(i) for i in range(10)]
res="Yes"
if s[a]!="-":
    res="No"
for i in range(0,a):
    if s[i] not in li:
        res="No"
for j in range(a+1,a+b+1):
    if s[j] not in li:
        res="No"
print(res)

Solution (Python):
a,b=map(int,input().split())
s=input()
if s.count('-')!=1:
	r='No'
else:
	t,u=s.split('-')
	if len(t)==a and len(u)==b and (t+u).isdecimal():
		r='Yes'
	else:
		r='No'
print(r)

Solution (Python):
def func(s, n):
    for i in range(10):
        if s[n] == str(i):
            return True
    return False
  
  
a, b = map(int,input().split())
s = input()

flg = True
if len(s) != a+b+1:
    flg = False

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

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

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

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

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

Solution (Python):
import re

A, B = [int(x) for x in input().split()]
S = input()
print ('Yes' if re.search(r'\A\d{{{}}}-\d{{{}}}\Z'.format(A, B), S) else 'No')

Solution (Python):
a, b = 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+b+1):
    if s[i] == '-':
        print("No")
        exit()

print("Yes")

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

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

Solution (Python):
dic = ["0","1","2","3","4","5","6","7","8","9"]

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

ok = True
for i in range(A):
    if not(S[i] in dic):
        ok=False

if S[A]!="-":
    ok=False

for i in range(A+1,A+B+1,1):
    if not(S[i] in dic):
        ok =False

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

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

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

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

Solution (Python):
from collections import Counter
a,b = map(int,input().split())
s = input()

if s[a]=='-' and '-' not in s[0:a] and '-' not in s[a+1:]:
    print('Yes')
else:
    print('No')

Solution (Python):
def resolve():
    a, b = map(int, input().split())
    s = input()
    
    flag_len = False
    flag_bar = False
    flag_num = True
    if a+b+1 == len(s):
        flag_len = True
    if s.count("-") == 1 and s[a] == "-":
        flag_bar = True
    if flag_len and flag_bar:
        for i in range(len(s)):
            code = ord(s[i])
            if code < ord("0") or ord("9") < code:
                if code!= ord("-"):
                    flag_num == False
                    break
                
    if flag_len and flag_bar and flag_num:
        print("Yes")
    else:
        print("No")
resolve()

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

lst = s.split("-")

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

Solution (Python):
a, b = 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+b+1):
    if s[i] == '-':
        print('No')
        exit()

print('Yes')

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

if s[a] != "-":
    result = "No"
elif len([x for x in s if x in [str(x) for x in range(10)]]) + 1 == len(s):
    result = "Yes"
else:
    result = "No"
print(result)

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

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

Solution (Python):
A, B = map(int, input().split())
S = input()
NUMS = "0123456789"
flg = True
for i in range(A):
  flg *= (S[i] in NUMS)
flg *= (S[A] == '-')
for i in range(A, A+B):
  flg *= (S[i+1] in NUMS)
if flg:
  print("Yes")
else:
  print("No")

Solution (Python):

import sys
input=sys.stdin.readline

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

if __name__=="__main__":
    main()

Solution (Python):
import sys
input = sys.stdin.readline


def main():
    integer = {"1","2","3","4","5","6","7","8","9","0"}
    a,b = [int(i) for i in input().strip().split()]
    s = input().strip()
    if len(s) != a + b + 1:
        print("No")
        return
    
    for n in s[:a]:
        if n not in integer:
            print("No")
            return
    if s[a] != "-":
        print("No")
        return
    for n in s[a + 2:]:
        if n not in integer:
            print("No")
            return
    
    print("Yes")
    return


if __name__ == "__main__":
    main()

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

for i in range(len(S)):
  if i == a:
    if not S[a]=="-":
      flag = False
  else:
    if not S[i].isnumeric():
      flag = False
if flag:
  print("Yes")
else:
  print("No")

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

print('Yes')

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

Solution (Python):
a, b = map(int, input().split())
s = input()
flg1 = s[:a].isdecimal()
flg2 = s[a] == "-"
flg3 = s[-b:].isdecimal()
flg = flg1 and flg2 and flg3
print(["No", "Yes"][flg])

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

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

if s1.isdigit() and s2=='-' and s3.isdigit():
    print('Yes' , flush=True)
else:
    print('No' , flush=True)

Solution (Python):
def solve():
    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')


if __name__ == "__main__":
    solve()

Solution (Python):
a,b = map(int,input().split())
s = list(input())
if s[a] != '-':
    print('No')
    exit()
s[a]='0'
for i in s:
    if i not in [str(j) for j in range(0,10)]:
        print('No')
        exit()
print('Yes')

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

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

ans = "No"

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

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

if "-" in S[:a] or  "-" in S[a+1:]:
    print("No")
elif "-" == S[a]:
    print("Yes")
else:
    print("No")

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

Solution (Python):
def solve():
    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')


if __name__ == "__main__":
    solve()

Solution (Python):
A,B = [int(i) for i in input().split()]
S = input()
try:
    if len(S) != A + B + 1:
        int("a")
    int(S[:A] + S[A+1:])
    if S[A] != "-":
        int("b")
    print("Yes")
except:
    print("No")