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):
def exit_No():
  print("No")
  exit()

def isNotNum(s):
  return not (ord('0') <= ord(s) <= ord('9'))


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


for i in range(A):
  if isNotNum(S[i]):
    exit_No()
    
if S[A] != '-':
  exit_No()

for i in range(B):
  if isNotNum(S[A+1+i]):
    exit_No()
    
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):
A, B = tuple(int(num) for num in input().split())
S = input()

s_list = list(S)
  
for i, s in enumerate(s_list):
  if i == A:
    if s_list[A] != '-':
      print('No')
      break
  else:
    try:
      s = int(s)
    except:
      print('No')
      break
else:
  print('Yes')

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

Solution (Python):
import re
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 S[0:A].isdigit() and S[A]== "-" and S[A+1:A+B+1].isdigit():
  print("Yes")
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=input()
f=True
if len(S)!=A+B+1:
    f=False
num=[chr(i) for i in range(ord('0'),ord('9')+1)]
for i,c in enumerate(S):
    if (i!=A and c not in num) or (i==A and c!='-'):
        f=False
        break
print('Yes' if f 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 = input()
if s[a] == "-" and s.count("-") == 1:
  print("Yes")
else:
  print("No")

Solution (Python):
a, b = map(int, input().split())
s = input()
if s[a] != "-":
  print("No")
  quit()
for i in range(a+b+1):
  if i < a:
    if s[i] == "-":
      print("No")
      quit()
  if a < i:
    if s[i] == "-":
      print("No")
      quit()
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):
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 not str.isdecimal(s):
    if str.isdecimal(s[:a]) and str.isdecimal(s[a + 1:]):
        print("Yes")
        exit()
print("No")

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

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

Solution (Python):
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    s = str(input().rstrip('\n'))
    d = collections.defaultdict(int)
    for i in range(10):
        d[str(i)]

    b = True
    for i in range(a + b + 1):
        if i < a:
            if s[i] not in d:
                b = False
                break
        elif i == a:
            if s[i] != "-":
                b = False
                break
        else:
            if s[i] not in d:
                b = False
                break
    if b:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    slove()

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"
        break
    if i != A and S[i] == "-":
        ans = "No"
        break
        
print(ans)

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

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

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

if(S[A] != "-"):
    print("No")
else:
    a = S[:A]
    b = S[A+1:]
    if(len(a) == A and len(b) == B and a.isdecimal() and b.isdecimal()):
        print("Yes")
    else:
        print("No")

Solution (Python):
A,B=map(int,input().split())
S=list(input())
count=0
for n in range(A):
  if S[n]!='-':
    count+=1
  else:
    break
if S[A]=='-':
  count+=1
for n in range(A+1,A+B+1):
  if S[n]!='-':
    count+=1
  else:
    break
if count==A+B+1:
  print('Yes')
else:
  print('No')

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

digits = [str(x) for x in range(10)]
for i in range(A):
  if S[i] in digits:
    pass
  else:
    print("No")
    exit()

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

for i in range(A+1, A+B+1):
  if S[i] in digits:
    pass
  else:
    print("No")
    exit()
print("Yes")

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

flag = True
for i in range(a):
    if s[i] == '-':
        flag = False
        break

if s[a] != '-':
    flag = False

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

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

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

Solution (Python):



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


ans = True
for i in range(A + B + 1):
    if i == A:
        if S[A] != '-':
            ans = False
            break
    else:
        if not S[i].isdigit():
            ans = False
            break


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

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

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

Solution (Python):
A,B = [int(x) for x in input().split()]
S = input()
for i in range(A+B+1):
  if i==A and S[i]!="-":
    print("No")
    exit()
  if i!=A and (S[i]=="-" or int(S[i])>=10):
    print("No")
    exit()
print("Yes")

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

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

Solution (Python):
import re
a, b = map(int, input().split())
s = input()
p1 = r"\d{"+ str(a) +"}"
p2 = r"\d{"+ str(b) +"}"
if s[a] == "-" and re.fullmatch(p1, s[0:a]) != None and re.fullmatch(p2, s[a+1:]) != None:
        print("Yes")
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):
import sys
from functools import reduce
import copy
import math
from pprint import pprint


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B] = string_to_int(inputs[0])
    S = inputs[1]
    code = S.split('-')
    if len(code) != 2 or len(code[0]) != A or len(code[1]) != B:
        return 'No'
    return 'Yes'


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)

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

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

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

Solution (Python):
A,B=map(int,input().split())
S=input()
print('NYoe s'[S[A]=='-' and S.count('-')==1::2])

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 = str(input())
if s[a]=='-':
    for i in range(a):
        if s[i]!='-':
            for j in range(a+1,a+b+1):
                if s[j]!='-':
                    print('Yes')
                    exit()
print('No')

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

if s[a]!='-':
  ans = 'No'
else:
  s = s.replace('-', '')
  if len(s)!=a+b:
    ans = 'No'
  if not all([i in '0123456789' for i in s]):
    ans = 'No'

    
print(ans)

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 bb084():
    a,b = list(map(int, input().split()))
    s = input()

    import re
    print('Yes' if re.compile('\d'*a + '-' + '\d'*b).match(s) else 'No')

bb084()

Solution (Python):


import sys
import re

sys.setrecursionlimit(100000)
MOD = 10 ** 9 + 7





A, B = [x for x in input().split()]
S = input()

pat = '\d{{{}}}-\d{{{}}}'.format(A, B)
result = re.match(pat, S)

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

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

    if len(s) != a + b + 1:
        return False
    for i, c in enumerate(s):
        if i == a:
            if c != '-':
                return False
        elif not c.isdecimal():
            return False
    return True


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

Solution (Python):
import sys
A,B = map(int,input().split())
S = list(input())
if S[A] != "-":
    print("No")
    sys.exit()
j = [str(i) for i in range(10)]
if len(S) != len([i for i in S if i in j and i != A])+1:
    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 and s[i] != '-':
    print('No')
    break
  elif i != a and s[i] == '-':
    print('No')
    break
else:
  print('Yes')

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):
import re
a,b = map(int, input().split())
s = input()

if len(s) == a + b + 1 and re.match(r"[0-9]{" + str(a) + "}-[0-9]{" + str(b) + "}", s):
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
A, B = map(int, input().split())
S = input()
for i in range(len(S)):
    if i == A:
        if S[i] != '-':
            print('No')
            sys.exit()
    else:
        if S[i].isdigit() is False:
            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')
            exit()
    if i != a:
        if not s[i].isdigit():
            print('No')
            exit()
print('Yes')

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())
li = input()
flag = True
for i in range(len(li)):
    if  li[a]   != "-" :
        flag = False
    if (i != a and li[i] == "-"):
        flag =False
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):


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

if S.count("-") == 1:
    hiphen = S.index("-")
    if A == hiphen and B == len(S) - 1 - hiphen:
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

Solution (Python):
import re

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

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

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

for i in range(len(s)):
    if i == a:
        if s[a] != "-":
            print("No")
            exit()
    else:
        if not "0" <= s[i] <= "9":
            print("No")
            exit()
print("Yes")

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())
S=input().split("-")
if len(S[0])==a and len(S[1])==b:
	print("Yes")
else:
	print("No")

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

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

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

d = ('1','2','3','4','5','6','7','8','9','0')

for i in range(len(s)):
    if i == a and s[a:a+1] != '-':
        print('No')
        exit()
    if i != a and s[i:i+1] not in d:
        print('No')
        exit()

print('Yes')

Solution (Python):
a,b=map(int,input().split())
s=list(input())
if s.count('-')>1:
    print('No')
    exit()
print('Yes' if s.pop(a)=='-' and len(s)==a+b and all(0<=int(i)<10 for i in s) else 'No')

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

Solution (Python):
import re
A,B = input().split()
S = input()
pattern = '[0-9]{'+A+'}-[0-9]{'+B+'}'
result = re.match(pattern,S)
if result :
    print('Yes')
else:
    print('No')

Solution (Python):

def main():
    A, B = tuple(map(int, input().split()))
    S = input().rstrip()
    flg = S[A] == "-" and all(i in "0123456789" for i in S[:A] + S[A + 1 :])
    print("Yes" if flg else "No")


if __name__ == "__main__":
    main()

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

count = 0
for s in S:
    if s == '-':
        break
    else:
        count += 1

S_list = []
for s in S:
    S_list.append(s)

hy_count = S_list.count('-')

if count == A and hy_count == 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()
for i in range(len(s)):
    if i == a:
        if s[i] != '-':
            print('No')
            exit()
        else:
            continue

    if not '0' <= s[i] <= '9':
        print('No')
        exit()
print('Yes')

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

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

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

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

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

for i in range(a):
    if s[i] not in ["0","1","2","3","4","5","6","7","8","9"]:
        y+=1
if s[a]!="-":
    y+=1
for i in range(a+1,a+b+1):
    if s[i] not in ["0","1","2","3","4","5","6","7","8","9"]:
        y+=1

if y==0:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    s = str(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__':
    slove()

Solution (Python):
import re
a,b = list(map(int, input().split()))
s = input()
pattern = re.compile(r"^\d{%d}-\d{%d}$" % (a,b))
print("Yes" if re.match(pattern, s) else "No")

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

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

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

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

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

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

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

Solution (Python):
line1 = [int(x) for x in input().strip().split()]
a = line1[0]
b = line1[1]

s = input().strip()

if s.count('-') != 1:
	print('No')
	exit(0)

components = s.split('-')
part1 = components[0]
part2 = components[1]

if len(part1) != a or len(part2) != b:
	print('No')
	exit(0)

for c in part1:
	if c < '0' or c > '9':
		print('No')
		exit(0)

for d in part2:
	if d < '0' or d > '9':
		print('No')
		exit(0)

print('Yes')

Solution (Python):
A,B = map(int, input().strip().split(' '))
S = input().strip()
S_ = ''.join(['0' if c in '0123456789' else c for c in S])
print('Yes' if S_ == '{}-{}'.format('0'*A,'0'*B) else 'No')

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

try:
    int(S[:A])
    int(S[A:])
except :
    print('No')
    exit()

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

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

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

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

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

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

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

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

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

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

Solution (Python):
A, B = map(int, input().split())
S = list(input())
if S[A] != '-':
    print('No')
    exit()
S.remove('-')
for s in S:
    if s.isdigit() == False:
        print('No')
        exit()
print('Yes')

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

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

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

Solution (Python):
import re

def main():
  a,b = map(int,input().split())
  s = input()
  target = r'^[0-9]{%d}-[0-9]{%d}$' % (a, b)
  postal_code = re.compile(target)
  
  if postal_code.match(s) is not None:
    print('Yes')
  else:
    print('No')

if __name__ == "__main__":
  main()

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

def solve() :
    for i in range(A+B+1) :
        if 0 <= i < A or A + 1 <= i <= A + B :
            if not 48 <= ord(S[i]) <= 57 :
                return 'No'
        else :
            if S[i] != '-' :
                return 'No'
    return 'Yes'
print(solve())

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

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

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

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""


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

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

X = map(int, S[:A:])
try:
    X = list(map(int, S[:A:]))
    Y = list(map(int, S[A + 1::]))
except:
    print("No")
    exit()

print("Yes")

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

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

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

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

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

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

    ok = True
    for i in range(A + B):
        if i == A:
            if s[i] != "-":
                ok = False
                break
        else:
            if s[i] not in "0123456789":
                ok = False
                break
    
    if ok:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Solution (Python):

A, B = map(int, input().split())
S = input()
num_list = list(map(str, list(range(0, 10, 1))))
ans_cnt = A + B + 1
cnt = 0
for i, s in enumerate(S):
    if i == A:
        if s == "-":
            cnt += 1
    else:
        if s in num_list:
            cnt += 1
if cnt == ans_cnt:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

A, B = ISI()
S = IS()
Num = ["0","1", "2", "3", "4", "5", "6", "7", "8", "9"]
a = S[:A]
b = S[A+1:]
c = S[A]
good = True
for _a in a:
    if _a in Num:
        continue
    else:
        good = False
for _b in b:
    if _b in Num:
        continue
    else:
        good = False
if c != "-":
    good = False
if good == True:
    print("Yes")
else:
    print("No")

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

judge = True
for i in range(A+B+1):
    if i == A:
        if S[i] != "-":
            judge = False
    else:
        if S[i] == "-":
            judge = False
if judge:
    print("Yes")
else:
    print("No")

Solution (Python):

import sys
import re
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b = map(int, input().split())
s = input()[:-1]

print('Yes' if re.fullmatch(
    '[0-9]{' + str(a) + '}-[0-9]{' + str(b) + '}', s) != None else 'No')

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

Solution (Python):
import re;a,_,s=open(0).read().split();print("YNeos"[s.count("-")>1or"-"!=s[int(a)]::2])

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()
b = ''.join(S[:A]).isdigit() and S[A] == '-' and ''.join(S[A+1:]).isdigit() and len(S) == A + B + 1
print('Yes' if b else 'No')

Solution (Python):
import re
A, B = map(int, input().split())
S = input()
postal = "^\d{{{}}}-\d{{{}}}$".format(A, B)
is_postal = re.match(postal, S)
if is_postal:
    print("Yes")
else:
    print("No")

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

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

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

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

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

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

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

l=s.split("-")
if len(l)!=2 or len(l[0])!=a or not l[0].isdigit() or len(l[1])!=b or not l[1].isdigit():
  print("No")
else:
  print("Yes")

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


if __name__ == '__main__':
    slove()

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=input()
print(("No","Yes")[s[a]=="-" and s[:a].isnumeric() and s[a+1:].isnumeric() and len(s)==a+b+1])

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

ans = s.split("-")

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

Solution (Python):
import sys
from statistics import *
from collections import *
from operator import itemgetter

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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