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())
line = input().split("-")

if len(line) != 2:
  print("No")

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

Solution (Python):
if __name__ == '__main__':
    A, B = map(int, input().split())
    S = list(str(input()))
    flag = True
    if S[A] == '-':
        S[A] = 0
    else:
        flag = False
    for i in range(A+B+1):
        try:
            int(S[i])
        except ValueError:
            flag = False
            break
    if flag:
        print('Yes')
    else:
        print('No')

Solution (Python):


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


res = 'Yes'
for i in range(len(S)):
    if i == A:
        if S[i] != '-':
            res = 'No'
            break
    else:
        if S[i] not in '0123456789':
            res = 'No'
            break


print(res)

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 not len(s)==a+b+1:
    print("No")
else:
    if not s.count("-")==1:
        print("No")
    else:
        if not s[a]=="-":
            print("No")
        else:
            print("Yes")

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()
valid = True
for i in range(len(s)):
    if (i + 1) <= a:
        if not ('0' <= s[i] <= '9'):
            valid = False
            break
    elif i + 1 == a + 1:
        if not s[i] == '-':
            valid = False
            break
    else:
        if not ('0' <= s[i] <= '9'):
            valid = False
            break
if valid is False:
    print('No')
else:
    print("Yes")

Solution (Python):
import re


def resolve():
    a, b = input().split()
    s = input()
    pattern = "\\d{{{a}}}-\\d{{{b}}}".format(a=a, b=b)
    if re.match(pattern, s):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    resolve()

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

Solution (Python):
def test():
    a,b = map(int,input().split())
    s = input()
    for i in range(a):
        if s[i].isdigit():
            pass
        else:
            print("No")
            return
    for j in range(a+1,len(s)):
        if s[j].isdigit():
            pass
        else:
            print("No")
            return
    if s[a] == "-":
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    test()

Solution (Python):
a, _ = 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()
SA = S[0:A]
SB = S[A+1:A+B+1]
if not(all(map(lambda c: c in "0123456789", SA))):
  print("No")
  exit()
if not(S[A] == "-"):
  print("No")
  exit()
if not(all(map(lambda c: c in "0123456789", SB))):
  print("No")
  exit()
print("Yes")

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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    a, b = map(int, input().rstrip('\n').split())
    s = input().rstrip('\n')
    ls = list("1234567890")
    for i in range(len(s)):
        if i < a:
            if s[i] not in ls:
                print("No")
                exit()
        elif i == a:
            if s[i] != "-":
                print("No")
                exit()
        elif b <= i:
            if s[i] not in ls:
                print("No")
                exit()
    print("Yes")


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    a, b = map(int, input().rstrip('\n').split())
    s = input().rstrip('\n')
    ls = list("1234567890")
    for i in range(len(s)):
        if i < a:
            if s[i] not in ls:
                print("No")
                exit()
        elif i == a:
            if s[i] != "-":
                print("No")
                exit()
        elif b <= i:
            if s[i] not in ls:
                print("No")
                exit()
    print("Yes")


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    a, b = map(int, input().rstrip('\n').split())
    s = input().rstrip('\n')
    ls = list("1234567890")
    for i in range(a + b + 1):
        if i < a:
            if s[i] not in ls:
                print("No")
                exit()
        elif i == a:
            if s[i] != "-":
                print("No")
                exit()
        elif b <= i:
            if s[i] not in ls:
                print("No")
                exit()
    print("Yes")


if __name__ == '__main__':
    main()

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

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

Solution (Python):
a,b = map(int,input().split())
s = input()
f = True
numeric = set("1234567890")
if s[a] != "-":
    f = False
for i in s[:a]:
   if not i in numeric:
       f = False
for i in s[a+1:]:
    if not i in numeric:
        f = False
if f:
    print("Yes")
else:
    print("No")

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

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

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

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

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

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

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().split("-")
s.append("-")

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

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


pC()

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

ans = True

for i in range(len(s)):
    if i == a:
        if s[i] != '-':
            ans = False
    else:
        if s[i] < '0' or '9' < s[i]:
            ans = False

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

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

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

for i,tmp in enumerate(s):
  if s.count('-')!=1:
    print('No')
    exit()
  if i==a and tmp!='-':
    print('No')
    exit()
    
print('Yes')

Solution (Python):
a,b = map(int,input().split())
s = str(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 = list(input())
if s[a] == "-":
    s.remove(s[a])

    ls = "0123456789"
    c = 0
    for i in s:
        if i in ls:
            c += 1

    if c == a+b:
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

for i in range(a):
  if s[i] in number :
    cnt = cnt +1
    
if s[a] == '-':
  cnt = cnt +1
      
for j in range(a+1,a+b+1):
  if s[j] in number :
    cnt = cnt + 1

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

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

S = input()

if S[A] == "-":
    if S[:A].isdigit():
        if S[A+1:].isdigit():
            print("Yes")
            exit(0)

print("No")

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

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

Solution (Python):
a,b=map(int,input().split())
s=input()
print('Yes' if s[a]=='-'and s[:a].isdecimal() and s[a+1:].isdecimal() 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):
A, B = map(int, input().split())
S = list(input())

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

if S[0:A].count("-") != 0 or S[A + 1:].count("-") != 0:
    print("No")
    exit()

print("Yes")

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

Solution (Python):
a,b =map(int, input().split())
s =input()
 
def main(a,b,s):
  if len(s) != a+1+b :
    return 'No'
 
  for n,i in enumerate(s) :
    if n == a :
      
      if i != '-' :
        return 'No'
    else :
      try :
        int(i)
      except :
        return 'No'
  return 'Yes'
              
print(main(a,b,s))

Solution (Python):
a,b=map(int,input().split())
s=input()
print("Yes" if s.count("-")==1 and s.index("-")==a 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):
import sys
a, b = map(int, input().split())
s = input()
if len(s) != a+b+1:
    print('No')
    sys.exit()

def check_hi(index,str):
    tmp = []
    for i,st in enumerate(str):
        if st == '-':
            tmp.append(i)
    if len(tmp)==1 and tmp[0]==index:
        return True
    else:
        return False

def check_int(i):
    if i == '-' or int(i) in [0,1,2,3,4,5,6,7,8,9]:
        return True
    else:
        return False

if check_hi(a,s) == False:
    print('No')
    sys.exit()

for si in s:
    if check_int(si) == False:
        print('No')
        sys.exit()
else:
    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()

for i in range(A):
    if 48 > ord(S[i]) or ord(S[i]) > 57:
        print('No')
        exit(0)
if S[A] != '-':
    print('No')
    exit(0)
for i in range(A + 1, len(S)):
    if 48 > ord(S[i]) or ord(S[i]) > 57:
        print('No')
        exit(0)
print('Yes')

Solution (Python):
a,b,*s=open(0).read().split()
s=s[0].split('-')
if len(s)==2 and len(s[0])==int(a) and len(s[1])==int(b):
  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.count('-') == 1:
    print('Yes')
else:
    print('No')

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

Solution (Python):
import re
A, B = list(map(str, input().split()))
s = input()
pattern = "[0-9]{" + A + "}-[0-9]{" + B + "}"
if re.match(pattern, s):
    print("Yes")
else:
    print("No")

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

pattern = '[0-9]{' +str(a)+ '}-[0-9]{' +str(b)+ '}'

search_result = re.search(pattern, content)

if not(search_result) :
  print("No")
elif search_result.group() == content:
  print('Yes')
else:
  print("No")

Solution (Python):
A, B = map(int, input().split())
S = input()
isvalid = all("0" <= c <= "9" for c in S[:A] + S[-B:]) and S[A] == "-"
print("Yes" if isvalid else "No")

Solution (Python):
a,b=input().split()
a,b=int(a),int(b)
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()
nums = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
isvalid = all(c in nums for c in S[:A] + S[-B:]) and S[A] == "-"
print("Yes" if isvalid else "No")

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

for i in range(len(s)):
    if 0 <= i and i <= a-1:
        if s[i] not in num:
            print('No')
            count += 1
            break
    elif i == a:
        if s[i] != '-':
            print('No')
            count += 1
            break
    else:
        if s[i] not in num:
            print('No')
            count += 1
            break

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

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

if S[A] == '-':
    try:
        int(S[:A] + '0' + S[A + 1:])
    except:
        print("No")
        exit()
    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:
    print("Yes")
else:
    print("No")

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

Solution (Python):
a, b = map(int, input().split())
s = list(input())
num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
if s[a] == '-' and len(s) == (a+b+1) and s.count('-')==1:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b = map(int,input().split())
s = input()
ans = "Yes"
try:
    for i in range(a+b+1):
        
        if i < a and s[i].isdigit():
            continue
        elif i == a and s[i] == "-":
            continue
        elif a < i < a+b+1 and s[i].isdigit():
            continue
        else:
            ans = "No"
            break
except:
    ans = "No"

print(ans)

Solution (Python):

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

left = s[0:a]
center = s[a]
right = s[a+1:a+b+1]

if left.isdigit() and center == '-' and right.isdigit():
    print('Yes')
else:
    print('No')

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

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

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

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

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

if any([S.count("-") != 1, S[0] == "-", S[-1] == "-"]):
  print ("No")
else:
  a, b = S.split("-")
  if len(a) == A and len(b) == B:
    print ("Yes")
  else:
    print ("No")

Solution (Python):
x, y = map(int, input().split())
s = input()
if s[:x].isnumeric() and s[-y:].isnumeric() and s[x] == '-':
    print('Yes')
else:
    print('No')

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

if N.count("-")==1:
  temp=N.split("-")
  left=temp[0]
  right=temp[1]
  if (len(left)==A)and(len(right)==B):
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

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

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

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

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

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

Solution (Python):
rule=[int(i) for i in input().split()]
nom=input()
if nom[rule[0]]=="-":
  if nom[rule[0]+1:].isdecimal() and nom[:rule[0]].isdecimal():
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

N = [str(a) for a in range(10)]
ans = 'Yes'
for i, s in enumerate(S):
    if i != A:
        if not s in N:
            ans = 'No'
    else:
        if s != '-':
            ans = 'No'
print(ans)

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

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

for c in s[0:a]:
    if "0" <= c and c <= "9":
        pass
    else:
        print("No")
        exit()

for c in s[a+1:]:
    if "0" <= c and c <= "9":
        pass
    else:
        print("No")
        exit()

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

print("Yes")

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

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

code = s.split('-')

if len(code[0]) == a and len(code[1]) == b and code[0].isdecimal() and code[1].isdecimal():
    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):
import sys

rule = list(map(int,input().split()))
S = str(input())
S_list = list(S.split('-'))

for i in range(len(S_list)):
	hoge_list = list(S_list[i])
	if len(hoge_list) != rule[i]:
		print('No')
		sys.exit()
print('Yes')

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')
      break
  else:
    if s[i] == '-':
      print('No')
      break
else:
  print('Yes')

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

Solution (Python):


def main():

    A,B = map(int,input().split())
    S = input()
    hihun = S[A]
    other = S[:A]+S[A+1:]

    print('Yes') if hihun == '-' and '-' not in other else print('No')









    
if __name__== "__main__":
    main()

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

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


def check(a,b,s):
    number=[str(i) for i in range(10)]
    if s[a]!="-":
        return False
    del s[a]
    if a+b!=len(s):
        return False
    for i in s:
        if not i in number:
            return False
    return True

if check(a,b,s):
    print("Yes")
else:
    print("No")

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

hantei = 1

for i in range(A+B+1):
    if S[i] == "-" and i != A:
        hantei = 0
        break

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

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

if S.count('-') != 1:
    print('No')
else:
    f,s = S.split('-')
    if len(f) == A and len(s) == B:
        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"]

flag = True

if not all(x in num for x in s[0:a]):
    flag = False

if not s[a] == "-":
    flag = False

if not all(x in num for x in s[a+1:a+1+b]):
    flag = False

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

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

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

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

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

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

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

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

Solution (Python):

import re

X = input().split(' ')

s = input()
if re.match('^(\d{' + X[0] + '}-\d{'+ X[1]+ '})$', s):
    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:
    if S[i] != '-':
      print('No')
      exit()
  else:
    if S[i] < '0' or S[i] > '9':
      print('No')
      exit()
print('Yes')

Solution (Python):
a,b=map(int,input().split());s=input().split("-");print("YNeos"[(len(s)!=2or len(s[0])!=a)::2])

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

ab = S.split("-", 2)
if len(ab) == 2 and len(ab[0]) == A and len(ab[1]) == B:
    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):
import re

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

pattern = r'^[0-9]{' + a + '}-[0-9]{' + b + '}$'
m = re.match(pattern, s)

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

Solution (Python):
import re
a,b = input().split()
s = input()
reg = re.compile(u'[0-9]{%s}-[0-9]{%s}' % (a, b))
print("Yes" if re.match(reg, s) else "No")

Solution (Python):
A,B = list(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()
flag = True
for i, ss in enumerate(s):
  if i == a:
    if ss != '-':
      flag = False
  else:
    if ord(ss) not in range(ord('0'), ord('9')+1):
      flag = False

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

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

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

Solution (Python):
import math



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



string = input()

try:
  int(string[0:a])
  int(string[a+1:a+b+1])
  if string[a] == "-":
    print("Yes")
  else:
    print("No")
except:
  print("No")

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

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

A, B = map(int, input().split())
S = input()
if is_int(S[:A]) and S[A] == '-' and is_int(S[A+1:]):
  print('Yes')
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):
a,b=map(int,input().split())
s=input()
ans="Yes"
front=""
back=""
if s.count("-")!=1:
    ans="No"
else:front,back=s.split("-")
if len(front)!=a or len(back)!=b:
    ans="No"
print(ans)

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

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

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

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

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'
    else:
        if s[i] != '-':
            ans = 'No'
print(ans)

Solution (Python):

A, B = map(int, input().split())
S = input()
ans = 'No'
flag = True
num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
if S[A] == '-':
    aa = S[0:A]
    bb = S[A+1:A+B+1]
    for i in range(len(aa)):
        if aa[i] not in num:
            flag  = False
    for k in range(len(bb)):
        if bb[k] not in num:
            flag = False
    if flag:
        ans = 'Yes'
print(ans)

Solution (Python):
a, b = map(int, input().split())
s = input()
try:
    Anum = (int)(s[:a])
    Bnum = (int)(s[b:])
    if s[a] == '-':
        print("Yes")
    else:
        print("No")
except ValueError:
    print("No")

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

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

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

if s[0] == "-" or s[-1] == "-":
  print("No")
  exit()

if len(s.split("-")[0]) != a:
  print("No")
else:
  print("Yes")

Solution (Python):
a, b = map(int, input().split())
c = input()
d = "1234567890"
for i in range(a):
    if c[i] not in d:
        print("No")
        exit()
for i in range(len(c)-1, len(c)-1-b, -1):
    if c[i] not in d:
        print("No")
        exit()
if c[a] != "-":
    print("No")
    exit()
print("Yes")

Solution (Python):
a,b=map(int,input().split())
s=input()
l=[s[i]!='-' for i in list(range(a))+list(range(a+1,a+b+1))]+[s[a]=='-']
print(['No','Yes'][all(l)])

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 permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())


def LIST(): return list(input())

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
S = LIST()
flag = False
if len(S) == A + B + 1:
    if S[A] == "-":
        for i in range(A):
            if S[i] != "-":
                for j in range(B):
                    if S[-1-j] != "-":
                        flag = True
if flag == True:
    print("Yes")
else:
    print("No")

Solution (Python):
import re
a, b = map(int, input().split())
s = input().rstrip()
result = 'Yes'

if len(s[:a]) != a or len(s[a+1:]) != b:
    result = 'No'
if re.fullmatch(r'\d+', s[:a]) is None or\
        re.fullmatch(r'\d+', s[a+1:]) is None:
    result = 'No'
if s[a:a+1] != '-':
    result = 'No'

print(result)

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

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

if c[a]=='-':
    for i in range(len(c)):
        if i==a:
            pass
        elif c[i]=='-':
            print('No')
            exit()
    print('Yes')
else:
    print('No')

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

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    a, b = map(int, input().split())
    s = list(input())

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

Solution (Python):
A,B = map(int,input().split())
S = list(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()
ans = 'No'
try:
    s1, s2 = s.split('-')
    if a == len(s1) and b == len(s2):
        ans = 'Yes'
except ValueError:
    pass
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')