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

res = True

if S[A] != '-':
  res = False

for i in range(A+B+1):
  if S[i] not in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] and i != A:
    res = False

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

Solution (Python):

a,b = (int(i) for i in input().split())
s = input()

a = int(a)
b = int(b)

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

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

Solution (Python):
a=map(int,raw_input().split());t=map(len,raw_input().split('-'));print['No','Yes'][a==t]

Solution (Python):
a=map(int,raw_input().split());t=map(len,raw_input().split('-'));print'Yes'if a==t else'No'

Solution (Python):
A, B = map(int, input().split())
S = input()
ans = "Yes"
if S[A] != "-":
    ans = "No"
if any([c == '-' for c in S[:A]]):
    ans = "No"
if any([c == '-' for c in S[A+B:]]):
    ans = "No"
print(ans)

Solution (Python):
import re

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

def is_num(s, n):
    return len(s) == n and (re.match(r"[0-9]+", s) is not None)

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

Solution (Python):
AB = input()
S = input()

A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])

ints = "0123456789"


flag = True

if len(S) != A + B + 1:
    flag = False

if flag:
    for i in range(len(S)):
        if i != A:
            if not(S[i] in ints):
                flag = False
        else:
            if S[i] != "-":
                flag = False

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

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

Solution (Python):
if __name__ == '__main__':
    info = list(map(int,input().split(" ")))
    S = input()
    if S[:info[0]].isdigit() and S[info[0]] == "-" and S[info[0]+1:].isdigit():
        print('Yes')
    else:
        print('No')

Solution (Python):

"""
Created on Sat Dec 30 21:39:36 2017

@author: kanako_note
"""

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

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

Solution (Python):
import re

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

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

if re.match(p, s) is None:
    print('No')
else:
    print('Yes')

Solution (Python):
import re

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

if re.match('^[0-9]{{{}}}-[0-9]{{{}}}$'.format(a,b), s) :
    print('Yes')
else :
    print('No')

Solution (Python):
import re

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

if re.match('^[0-9]{' + a + '}-[0-9]{' + b + '}$', s):
    print('Yes')
else :
    print('No')

Solution (Python):

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

flag = 1

for i in range(a):
    if string[i] == '-':
        flag = 0

if string[a] != '-':
    flag = 0

for i in range(a+1,a+b+1):
    if string[i] == '-':
        flag = 0

if flag == 1:
    print("Yes")

else:
    print("No")

Solution (Python):
import re
A, B = (int(i) for i in input().split())
if re.match(r"\d{%s}-\d{%s}" % (A, B), input()):
  print("Yes")
else:
  print("No")

Solution (Python):
[a, b] = [int(i) for i in input().split()]
s = input().strip()
if (s[a] == "-") and (sum([c in "0123456789" for c in s]) == a + 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):
num = raw_input().split(" ")
l = raw_input().split("-")

if len(l) == 2 and len(l[0]) == int(num[0]) and len(l[1]) == int(num[1]):
  print "Yes"
else:
  print "No"

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

det = "Yes"

for i in range(len(s)):
    if i < a and (ord(s[i]) < ord('0') or ord(s[i]) > ord('9')):
        det = "No"
        break
    elif i == a and s[i] != '-':
        det = "No"
        break
    elif i > a and (ord(s[i]) < ord('0') or ord(s[i]) > ord('9')):
        det = "No"
        break

print(det)

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

Solution (Python):
a,b = map(int,input().split())
N = input()
p = 1
for i in range(a):
    if N[i] == "-":
        p = 0
    elif N[i] == "0" or "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9":
        p = p
    else:
        p = 0
if N[a] == "-":
    p = p
else:
    p = 0
for j in range(b):
    if N[a+1+j] == "-":
        p = 0
    elif N[a+1+j] == "0" or "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9":
        p = p
    else:
        p = 0

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

Solution (Python):
import re

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

if re.match(r'\d{' + a + '}-\d{' + b + '}', s):
    print('Yes')
else:
    print('No')

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

if S[0:A[0]].isdigit() == False or S[A[0]+1:].isdigit() == False or S[A[0]] != '-' or len(S[0:A[0]]) != A[0] or len(S[A[0]+1:]) != A[1] :
	print('No')
else:
	print('Yes')

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

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

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

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

Solution (Python):
data = input().split()
A = int(data[0])
B = int(data[1])
S = input()
s1 = S[:A]
s2 = S[A:A+1]
s3= S[len(S)-B:]
if s1.isdigit() == True:
    if s2 == "-":
        if s3.isdigit() == True:
            print("Yes")
        else : 
            print("No")
    else:
        print("No")
else :
    print("No")

Solution (Python):
from re import match
import sys
AB = list(map(int,input().split()))
print("Yes" if match("[0-9]{%d}-[0-9]{%d}"%(AB[0],AB[1]),input()) else "No")

Solution (Python):
[a, b] = list(map(int, input().split()))
s = str(input())
finalAns = True
for p in range(a + b):
    if p == a:
        if s[p] != "-":
            finalAns = False
    else:
        if s[p].isdigit == False or s[p] == "-":
            finalAns = False

if finalAns == True:
    print("Yes")
else:
    print("No")

Solution (Python):

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

for n in range(len(S)):
    if n is A:
        if S[n] is not '-':
            print('No')
            sys.exit()
    else:
        if S[n] not in ['0','1','2','3','4','5','6','7','8','9']:
            print('No')
            sys.exit()
print('Yes')

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

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

S = input()

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



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


for i in range(A):
	if S[i] in l:
		continue
	
	print("No")
	exit(0)


for i in range(A+1, A+B+1):
	if S[i] in l:
		continue
	
	print("No")
	exit(0)


print('Yes')

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

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

Solution (Python):
import re
A, B = map(int, raw_input().split(' '))
S = raw_input()


if len(S) != A + B + 1 or '-' not in S or not re.match('[0-9\-]', S[-1]):
    print 'No'
else:
    a, b = map(len, S.split('-'))[:2]
    if a != A or b != B:
        print 'No'
    else:
        print 'Yes'

Solution (Python):

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

A_ = A+1
value = list(map(str ,list(range(10))))
count = 1
flag = True
count_ = 0
for i in S:
    if count==A_:
        if i == '-':
            flag = False
    else:
        for j in value:
            if i==j:
                count_ += 1
    count+=1


if count_==len(S)-1 and flag==False:
    print('Yes')
else:
    print('No')

Solution (Python):
a=input().split()
A=int(a[0])
B=int(a[1])
S=input()
S=list(S)

t=1

for i in range(A):
 if(S[i]=="-"):
  t=0

if(S[A] != "-"):
  t=0

for i in range(A+B):
 if(i>A):
  if(S[i]=="-"):
   t=0

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

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

S = input()

Ans = 0

for i in range(A):
	if S[i].isdigit() == False:
		Ans = 1

if S[A] != "-":
	Ans = 1

for i in range(A+1,len(S)):
	if S[i].isdigit() == False:
		Ans = 1
		
if Ans == 0:
	print("Yes")
	
if Ans == 1:
	print("No")

Solution (Python):



import sys
import re

a, b = sys.stdin.readline().strip().split(" ")
s = sys.stdin.readline().strip()
a = int(a)
b = int(b)
m = re.match(r'(\d+)(-)(\d+)', s)
if m is None:
    print("No")
else:
    if len(m.group(1)) == a and m.group(2) == "-" and len(m.group(3)) == b:
        print("Yes")
    else:
        print("No")

Solution (Python):

a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
  n = s.count('-')
  if n == 1:
    x,y = map(str, s.split('-'))
    if len(x) == a:
      if len(y) == b:
        ok = True

if ok:
  print 'Yes'
else:
  print 'No'

Solution (Python):
a,b = map(int, input().split())
s=str(input())
ok=True
for i in range(a+b+1):
    if(i==a):
        if(not s[i]=='-'):
            ok=False
    else:
        subs=s[i:i+1]
        if(not subs.isdecimal()):
            ok=False

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

Solution (Python):


A,B=[int(i) for i in input().split()]
S=input()
flag = 1
L = A+B+1
if len(S)== L:
    for i in range(L):
        if (i != A and S[i] == '-'):
            flag = 0
        if (i == A and S[i] != '-'):
            flag = 0
else:
    flag = 0
 
if flag == 1:
    print('Yes')
else:
    print('No')

Solution (Python):
from pprint import pprint as pp
"""
問題文
Atcoder国では、郵便番号は A+B+1 文字からなり、A+1 文字目はハイフン -、それ以外の全ての文字は 0 以上 9 以下の数字です。
文字列 S が与えられるので、Atcoder国の郵便番号の形式を満たすかどうか判定してください。
制約
    1≦A,B≦5
    |S|=A+B+1
    S は 0 以上 9 以下の数字、およびハイフン - からなる
S がAtcoder国の郵便番号の形式を満たすならば Yes 、そうでなければ No を出力せよ。
"""
a,b=map(int, input().split())
s=input()

def check(it):
    if len(it) != a+b+1:
        return False
    for e in it[:a]:
        if '0' <= e <= '9':
            pass
        else:
            return False
    for e in it[a+1:]:
        if '0' <= e <= '9':
            pass
        else:
            return False
    if it[a] != '-':
        return False
    return True

if check(s):
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
n,m = raw_input().split()
ch = ['0','1','2','3','4','5','6','7','8','9']
f = True
s = raw_input()

for i in range(int(n)):
	if s[i] not in ch:
		f = False
if s[int(n)] != '-':
	f = False
for i in range(int(n)+1,len(s)):
	if s[i] not in ch:
		f = False
if len(s) > (int(n)+int(m)+1):
	f = False
if f:
	print "Yes"
else:
	print "No"

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

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


digits = ['0','1','2','3','4','5','6','7','8','9']
def solve():
    for i in range(A + B + 1):
        if i == A:
            if S[i] != '-':
                return False
        else:
            if S[i] not in digits:
                return False
    return True
if solve():
    print("Yes")
else:
    print("No")

Solution (Python):
import sys

a, b = sys.stdin.readline().strip().split()
s = sys.stdin.readline().strip()

for i in range(int(a)):
    try:
        if int(s[i]) < 0 or int(s[i]) > 9:
            print("No")
            sys.exit(0)
    except:
        print("No")
        sys.exit(0)
if s[i+1] != "-":
    print("No")
    sys.exit(0)
for j in range(i+2, i+1+int(b)):
    try:
        if int(s[j]) < 0 or int(s[j]) > 9:
            print("No")
            sys.exit(0)
    except:
        print("No")
        sys.exit(0)
print("Yes")

Solution (Python):
import sys
A,B=map(int,sys.stdin.readline().split())
S=sys.stdin.readline().strip()
if len(S)==(A+B+1) and S[A]=='-' and all(map(lambda c: '0'<=c<='9',S[:A]+S[A+1:])):
  print('Yes')
else:
  print('No')

Solution (Python):
a,b = map(int,raw_input().split(" "))
data = raw_input()
if data.count("-") != 1:
  print "No"
  exit(0)
A,B = data.split("-")
if len(A)==a and len(B)==b:
  print "Yes"
else:
  print "No"

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

res = 'Yes'
if s[a] != '-':
  res = 'No'
for i,c in enumerate(s):
  if i != a:
    if c == '-':
      res = 'No'
      break

print(res)

Solution (Python):
def solve():
    while 1:
        try:
            A, B = list(map(int, input().split(" ")))
            S = list(input())
            if S[A] != "-":
                print("No")
                raise EndLoop

            for a in S[:A]:
                if not 48 <= ord(a) <= 57:
                    print("No")
                    raise EndLoop

            for b in S[A + 1:]:
                if not 48 <= ord(b) <= 57:
                    print("No")
                    raise EndLoop

            print("Yes")
            break

        except:
            break


solve()

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

ok = True
if s[a] != '-':
  ok = False
for c in s[:a] + s[a+1:]:
  if c not in '0123456789':
    ok = False

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

Solution (Python):
n,m = map(int, input().split())
s = input()

a, b = all([l.isnumeric() for l in s[:n]]), all([l.isnumeric() for l in s[n+1:]])

if a and b and s[n]=='-':
    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']

flg = 0

for i in range(a):
    if s[i] in nums:

        pass
    else:
        flg = 1

if s[a] != '-':
    flg = 1

for i in range(a+1,a+b+1):


    if s[i] in nums:
        pass
    else:
        flg = 1

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

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

n=[str(i) for i in range(0,10)]
i=1


for s in ss:
    if s not in n and i!=a+1:
        print("No")
        sys.exit()
    if i==a+1:
        if s !="-":
            print("No")
            sys.exit()
    i+=1

print("Yes")

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

Solution (Python):


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

print("No")

Solution (Python):
def slove(a, b, s):
    if s[a] != "-":
        return "No"
    for i in range(a + b + 1):
        if i == a:
            pass
        else:
            if s[i].isdigit() == False:
                return "No"
    return "Yes"

if __name__ == "__main__":
    ab = input().split()
    a = int(ab[0])
    b = int(ab[1])
    s = list(input())

    print(slove(a, b, s))

Solution (Python):
import re
a, b = map(int, input().split())
s = input()
if re.match(r'[0-9]{' + re.escape(str(a)) + '}-[0-9]{' + re.escape(str(b)) + '}', s):
  print('Yes')
else:
  print('No')

Solution (Python):
a,b = map(int,input().split())
s = input()
check = 1
if s[a] != '-':
	print('No')
else:
	for i in range(a):
		if s[i] == '-':
			check = -1
			break
	for k in range(a+1,a+b+1):
		if s[k] == '-':
			check = -1
			break
	if check == 1:
		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].isdigit() == False:
            print('No')
            exit()
print('Yes')

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

s = S.split("-")

if len(s) == 2 and A == len(s[0]) and B == len(s[1]):
	print("Yes")
else:
	print("No")

Solution (Python):

A,B = [int(x) for x in input().split()]
S = input()
if S[:A].isdigit()  and S[A] == "-"  and S[A+1:].isdigit() and len(S) == (A+B+1):
    print("Yes")
else:
    print("No")

Solution (Python):
def ss(x):
  if x in ('1','2','3','4','5','6','7','8','9','0'):
    return 0
  else:
    return 1

a,b=[int(i) for i in input().split(' ')]
n=input()
x=0
for i in range(len(n)):
  
  if i<a:
    x+=ss(n[i])
  elif i==a:
    if n[i]!='-':
      x+=1
  elif i<=a+b:
    x+=ss(n[i])
  elif i>a+b:
    x+=1

if x>0:
  print('No')
else:
  print('Yes')

Solution (Python):


import re

l = input().split()
a = int(l[0])
b = int(l[1])
pc = input()

result = re.fullmatch(r'[0-9]{%d}-[0-9]{%d}' % (a, b), pc)
if result:
    print('Yes')
else:
    print('No')

Solution (Python):
AB = input().split(' ')
S = input().split('-')
if len(S) == 2 and len(S[0]) == int(AB[0]) and len(S[1]) == int(AB[1]):
  print('Yes')
else:
  print('No')

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

ans=True
if len(S) != A+B+1 or S[A] != '-':
    ans=False
else:
    A_str = S[0:A]
    B_str = S[A+1:A+B+1]
    
    if ( not A_str.isdigit() ) or ( not B_str.isdigit() ):
        ans=False

ans_str = 'Yes' if ans==True else 'No'
print(ans_str)

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

good = True
for i in range(a):
    if not s[i].isdigit():
        good = False
        break

if good and s[a] == "-":
    for i in range(a+1,a+b+1):
        if not s[i].isdigit():
            good = False
            break
else:
    good = False

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

Solution (Python):
import numpy as np

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

s = s.split("-")

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

Solution (Python):


import re
import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        A, B = map(lambda x: int(x), line.rstrip("\n").split(" "))
        S = sys.stdin.readline().rstrip("\n")
        pattern = "\d{{{0}}}-\d{{{1}}}$".format(A, B)
        if re.match(pattern, S):
            print "Yes"
        else:
            print "No"

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)

Solution (Python):

import re

a, b = map(str, input().split())
pattern = r"^\d{" + a + "}-\d{" + b + "}$"
repattern = re.compile(pattern)

rematch = repattern.match(input())

if rematch == None:
    print('No')
else:
    print('Yes')

Solution (Python):
import re
a,b = map(int, input().split(" "))
c = list(input())
flag = 1
for i in range(a):
    if(re.match(r"\d",c[i])):
        pass
    else:
        flag = 0
if(re.match(r"-",c[a])):
    pass
else:
    flag = 0
for i in range(b):
    if(re.match(r"\d",c[a+1+i])):
        pass
    else:
        flag = 0
if(flag):
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
a, b = map(int, raw_input().split())
s = raw_input()
num = [str(i) for i in xrange(10)]
for i in xrange(a):
    if not s[i] in num:
        print "No"
        sys.exit()

if not s[i+1] == "-":
    print "No"
    sys.exit()

for i in xrange(b):
    if not s[i+a+1] in num:
        print "No"
        sys.exit()

print "Yes"

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

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

main()

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

Solution (Python):
import sys
a, b = map (int, sys.stdin.readline().split())
s = sys.stdin.readline().strip()
ok = 0
if s[a] == '-':
  t = s.split('-')
  if len (t) == 2:
    if len (t[0]) == a and len (t[1]) == b:
      ok = 1

print (["No", "Yes"][ok])

Solution (Python):
import re

def getInput():
    """

    :return: list of list of str. 1st dim: row, 2nd dim: column.
    """
    separator = ' '
    ret_array = []
    while True:
        try:
            row = input().split(sep=separator)
            ret_array.append(row)
        except EOFError:
            break
    return ret_array


g = getInput()

A, B = map(int, g[0])
S = g[1][0]
p = '[0-9]{{{0}}}-[0-9]{{{1}}}'.format(A, B)
if re.match(p, S):
    print("Yes")
else:
    print("No")

Solution (Python):

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

Solution (Python):
a, b = (int(i) for i in input().split())
S = [len(i) for i in input().split('-')]

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

Solution (Python):
a, b = map(int, input().split())
s = input()
n = list(range(10))
if s[a] == '-':
    ss = s.split('-')
    try:
        int(ss[0])
        int(ss[1])
        print('Yes')
    except:
        print('No')
else:
    print('No')

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

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

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

Solution (Python):
import re

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

m=re.fullmatch('\d{'+a+'}-\d{'+b+'}',s)
print('No' if m is None else 'Yes')

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

for i in range(len(S)):
    if i == A:
        if S[i] != "-":
            print("No")
            exit()
    if i != A and S[i] == "-":
        print("No")
        exit()

print("Yes")

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

def isNum(c):
    return ord('0') <= ord(c) and ord('9') >= ord(c)
flag = True
for c in S[:A]:
    if not isNum(c):
        flag = False
        break
if S[A] != '-':
    flag = False
for c in S[A+1:]:
    if not isNum(c):
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):


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

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

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

Solution (Python):
A, B = map(int, input().split())
S = input()
flag = True
if S[A] != "-":
    flag = False
else:
    for i in range(len(S)):
        if i != A and not S[i].isdigit():
            flag = False

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

Solution (Python):

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

data = S.split('-')

if len(data) != 2:
    print('No')
else:
    if len(data[0]) == A and len(data[1]) == B:
        if data[0].isdigit() and  data[1].isdigit():
            print('Yes')
        else:
            print('No')
    else:
        print('No')

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

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

Solution (Python):
def is_good(s, sz):
    if len(s) != 2:
        return False
    if len(s[0]) != sz[0] or len(s[1]) != sz[1]:
        return False
    return True

sz = list(map(lambda x: int(x), input().split(' ')))
s = input().split('-')

if is_good(s, sz):
    print('Yes')
else:
    print('No')

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

    al = [str(i) for i in range(0, 10)]

    f = 1
    for x in range(len(s)):
        if x == a:
            if s[x] == "-":
                f = 1
            else:
                f = 0
                break
        else:
            if s[x] not in al:
                f = 0
                break

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



if __name__ == "__main__":
    main()

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

if not S[:A].isdigit():
    print("No")
elif S[A] != "-":
    print("No")
elif not S[A+1:].isdigit():
    print("No")
else:
    print("Yes")

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

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

Solution (Python):
A,B=map(int, input().split())
S=input()
if S[A]=="-":
    st=S.split("-")
    n=st[0];m=st[1]
    if n.isdigit() and m.isdigit():
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

Solution (Python):
import sys

def solve(a, b, s):
    for i in range(len(s)):
        if i == a:
            if s[i] != "-":
                return 0
        else:
            if "0" <= s[i] <= "9":
                pass
            else:
                return 0
    return 1

a, b = [int(x) for x in sys.stdin.readline().strip().split()]
s = sys.stdin.readline().strip()

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

Solution (Python):
n, m= list(map(int, input().split()))
a = list(input())
dig = "1234567890"
ans = "Yes"
for i in range(n):
    if a[i] not in dig:
        ans = "No"
if a[n] != "-":
    ans = "No"
for l in range(n+1, n+m+1):
    if a[l] not in dig:
        ans = "No"
print(ans)

Solution (Python):
temp=input().split(" ")
temp=list(map(int,temp))
a=temp[0]
b=temp[1]
temp=input().split("-")
if len(temp)!=2:
    print("No")


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

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

S = input()

def it():
  try:
    for c in S[:A]:
      yield int(c) in range(10)
    yield S[A] == '-'
    for c in S[A+1:]:
      yield int(c) in range(10)
  except ValueError:
    yield False

print('Yes' if all(it()) else 'No')

Solution (Python):



import re

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

    pattern = r"\A[0-9]{{{}}}-[0-9]{{{}}}\Z".format(A, B)
    ok = re.fullmatch(pattern, S)

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

if __name__ == "__main__": main()

Solution (Python):
import sys

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

if (len(S) != A + B + 1):
    print('No')
    sys.exit()

ng = False
for i in range(A):
    n = ord(S[i]) - ord('0')
    if (n < 0 or n > 9):
        ng = True

for i in range(A + 1, A + B + 1):
    n = ord(S[i]) - ord('0')
    if (n < 0 or n > 9):
        ng = True

if (S[A] != '-'):
    ng = True

print('Yes' if not ng else 'No')

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

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

answer = True
for i in range(len(s)):
    if i == a:
        if s[i] != '-':
            answer = False
            break
    else:
        if s[i] == '-':
            answer = False
            break
        if int(s[i]) < 0 or int(s[i]) > 9:
            answer = False
            break

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

Solution (Python):
a, b = map(int, raw_input().split())
s = raw_input().split('-')
print 'Yes' if len(s[0]) == a and not [_ for _ in s[0] if _ not in '0123456789'] and \
               len(s[1]) == b and not [_ for _ in s[1] if _ not in '1234567890'] else 'No'

Solution (Python):
a, b = [int(x) for x in input().split()]
s = input()
pre, aft = s[:a], s[a+1:]
h = s[a]

ans = 'Yes'

if '-' in pre:
    ans = 'No'

if '-' in aft:
    ans = 'No'

if h != '-':
    ans = 'No'

if len(aft) != b:
    ans = 'No'

print(ans)

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

res = "Yes"

for i in range(A):
    if S[i] not in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]:
        res = "No"
if S[A] != "-":
    res = "No"
for i in range(A+1, A+B+1):
    if S[i] not in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]:
        res = "No"
print(res)

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

if "-" not in S:
    print("No")
elif S.count("-") > 1:
    print("No")
else:
    a,b = S.split("-")
    if (len(a) == A) and (len(b)==B):
        print("Yes")
    else:
        print("No")

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

Solution (Python):


import string


def validate(a, b, s):
    if not s[a] == "-":
        return False
    for i in range(len(s)):
        if i != a and s[i] not in string.digits:
            return False
    return True


def main():
    a, b = (int(x) for x in input().split())
    s = input()
    print("Yes" if validate(a, b, s) else "No")


if __name__ == '__main__':
    main()