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 = [int(i) for i in input().split()]
S = list(input())
if '-' in S:
    S[A] = '='
    if '-' in S:
        print('No')
    else:
        print('Yes')
else:
    print('No')

Solution (Python):
import re

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

regex = '[0-9]{%d}-[0-9]{%d}' %(a,b)
print('Yes' if re.match(regex, s) else 'No')

Solution (Python):
import re
A,B=input().split()
S = input()
exp = "\d{" + A + "}-\d{" + B + "}"
regexp = re.compile(exp)
if regexp.match(S):
    print("Yes")
else:
    print("No")

Solution (Python):
A,B=map(int,input().split())
S = input()
digits = list(map(str,list(range(0,10))))
if S[A] != "-":
        print("No")
        exit()
for i in range(A+B+1):
    if i != A:
        if S[i] not in digits:
            print("No")
            exit()
print("Yes")

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

    if not (len(S) == A+B+1):
        print("No")
        return
    
    An = S[:A]
    Bn = S[-B:]
    c = S[A:-B]

    if not (An.isdecimal() and Bn.isdecimal() and c=="-"):
        print("No")
        return
    print("Yes")

if __name__ == '__main__':
    main()

Solution (Python):
A,B = map(int,input().split())
S = input()
if S.count('-') != 1 or len(S) != A + B + 1:
    print('No')
elif [len(i) for i in S.split('-')] == [A,B]:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b=map(int,raw_input().split())
s=raw_input()
import re
if re.match('\d{%d}-\d{%d}' % (a,b), s):
  print 'Yes'
else:
  print 'No'

Solution (Python):

"""
Created on Wed Jun 20 16:39:29 2018

@author: Yuya
"""



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

S = list(input())

S_A = "".join(list(S[0:A]))
S_B = "".join(list(S[A]))
S_C = "".join(list(S[A+1:A+B+1]))

if str.isnumeric(S_A) and S_B == "-" and str.isnumeric(S_C):
    print("Yes")
else:
    print("No")

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

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

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

if len(s) == (a+b+1) and all([c != '-' for c in s[:a]+s[a+1:]]) and s[a] == '-':
  print('Yes')
else:
  print('No')

Solution (Python):
a, b = map(int, input().split())
s = input()
res = False
if len(s.split('-')) == 2:
  sa, sb = s.split('-')
  res = len(sa)==a and len(sb)==b and all(c in '0123456789-' for c in s)
print('Yes' if res else 'No')

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):
def number(c):
    c = str(c)
    ans = 0
    s = "0123456789"
    for i in range(10):
        if c == s[i]:ans = 1
    return ans

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

Solution (Python):


A,B=map(int,input().split())
S=input()
for i in range(A):
    try:
        T=int(S[i])
    except ValueError:
        print("No")
        exit()
if S[i+1]!="-":
    print("No")
    exit()

for i in range(B):
    try :
        T=int(S[A+1+i])
    except ValueError:
        print("No")
        exit()
print("Yes")

Solution (Python):


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


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

Solution (Python):
A, B = map(int, input().split())
s = input()
for i in range(len(s)):
    if i<A and s[i]=='-':
        print("No")
        exit()
    elif i==A and s[i]!='-':
        print("No")
        exit()
    elif A<i<=A+B and s[i]=='-':
        print("No")
        exit()
print("Yes")

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].isdigit() == False:
            res = 'No'

print(res)

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

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

Solution (Python):
nums = [str(e) for e in range(10)]
a, b = map(int, input().split())
S = input()
flag = True
for idx in range(len(S)):
  if idx == a:
    if S[idx] != '-':
      flag = False
      break
  else:
    if S[idx] not in nums:
      flag = False
      break

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

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

Solution (Python):
a,b = map(int,input().split())
S = input()
def crazy(a,b,S):
    num = "0123456789"
    if S[a] != "-":
        return False
    for i in S[:a]:
        if i not in num:
            return False
    for i in S[a + 1:]:
        if i not in num:
            return False
    return True

if crazy(a,b,S):
    print("Yes")
else:
    print("No")

Solution (Python):
userIn = input().split()
s = input()
a = int(userIn[0])
b = userIn[1]

if s.find('-') == a and s.rfind('-') == a:
    print("Yes")
else:
    print("No")

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


def judge(S):
    for i in range(len(S)):
        if (i == A and S[i] != "-")or (i != A and S[i] == "-"):
            return "No"
    return "Yes"


print(judge(S))

Solution (Python):
A,B=[int(i) for i in 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] == "-":
    if "-" in S[:A] or "-" in S[A+1:]:
        print("No")
    else:
        print("Yes")
else:
    print("No")

Solution (Python):
a,b = map(int,input().split())
s = input()
for i,c in enumerate(s):
    if i==a:
        if c!='-':
            print('No')
            exit()
    else:
        if c=='-':
            print('No')
            exit()
print('Yes')

Solution (Python):

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

flag = True
if S[A] != "-":
    flag = False
else:
    try: a = int(S[:A]) + int(S[-B:])
    except ValueError: flag = False

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

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

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

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

if N[a] == "-":
    del N[a]
else:
    print("No")
    exit()

if "-" in N:
    print("No")
    exit()
else:
    print("Yes")

Solution (Python):
num,num2 = map(int,input().split())
num3 = input()
l = [str(i) for i in range(10)]
count = []
c = 0
for i in num3:
    if(i in l):
        c += 1
    else:
        count.append(c)
        c = 0
count.append(c)
if(num == count[0] and num2 == count[1]):
    print("Yes")
else:
    print("No")

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

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

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

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

Solution (Python):
import sys

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

if '-' in S[:A]:
    print('No')
    sys.exit()

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

if '-' in S[A + 1:]:
    print('No')
    sys.exit()

print('Yes')

Solution (Python):
a,b = map(int, raw_input().split())
s = raw_input()
digi = all([ord('0') <= ord(c) and ord(c) <= ord('9') for c in s[:a] + s[a+1]])
if s[a] == '-' and digi:
    print "Yes"
else:
    print "No"

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

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

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

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

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

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

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

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

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

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

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

if len(S) == A+B+1 and S[A]=="-" and S[:A].isdigit() and S[len(S)-B:].isdigit():
    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 = list(map(int, input().split()))
try:
    x, y = input().split('-')
    print('Yes') if a==len(x) and b==len(y) else print('No')
except:
    print('No')

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

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

if len(s) == a+b+1:
    if s[a] == "-":
        s.pop(a)
        for i in s:
            if i == "-":
                print("No")
                sys.exit()
    else:
        print("No")
        sys.exit()
else:
    print("No")
    sys.exit()
print("Yes")

Solution (Python):
a, b = map(int, input().split())
s = list(input())
flag = True
if len(s) == a+b+1:
    if s[a] == "-":
        s.pop(a)
        for i in s:
            if i == "-":
                flag = False
    else:
        flag = False
else:
    flag = False
if flag:
    print("Yes")
else:
    print("No")

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

Solution (Python):
def valid(a, b, s):
    if len(s) == a + b + 1 and s[a] == '-':
        return all(map(lambda c: c in '0123456789', s[:a] + s[a+1:]))
    else:
        return False


if __name__ == '__main__':
    a, b = map(int, input().split())
    s = input()
    print('Yes') if valid(a, b, s) else print('No')

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

if s[:a].isdigit():
    if s[a] == '-':
        if s[a+1:].isdigit():
            print("Yes")
            s = None

if s is not None:
    print("No")

Solution (Python):
A, B = map(int, input().split())
S = input()
D = ["0","1","2","3","4","5","6","7","8","9"]

for k in range(A):
    if S[k] not in D:
        print("No")
        exit(0)

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

for k in range(A+1,A+B+1):
    if S[k] not in D:
        print("No")
        exit(0)
print("Yes")

Solution (Python):
import re
a,b=map(int,input().split())
s=input()
if re.match('[0-9]'*a + '\-' + '[0-9]'*b, s) != None:
    print('Yes')
else:
    print('No')

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

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

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

sl = s.split('-')
if len(sl) != 2:
    print('No')
elif ( sl[0].isdecimal() and len(sl[0]) == a ) and ( sl[1].isdecimal() and len(sl[1]) == b):
   print('Yes')
else:
    print('No')

Solution (Python):
import re
ab = list(map(int, input().split()))
S = input()
if S[ab[0]] != '-':
    print("No")
    exit()

s = S.split('-')
if len(s) > 2:
    print("No")
    exit()

for i in range(2):
    if not ( len(s[i]) == ab[i] and re.compile(r'\d').match(s[i]) ):
        print("No")
        exit()
print("Yes")

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

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

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

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

Solution (Python):
a, b = map(int,input().split())
s=list(input())
f=0
for i in range(0,a):
   
    if(s[i]<'0' or s[i]>'9'):
        f=1
        break

if(s[a]!='-'):
    f=1
               
for i in range(a+1,a+1+b):
   
    if(s[i]<'0' or s[i]>'9'):
        f=1
        break
if(f==0):
    print("Yes")
else:
    print("No")

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

Solution (Python):
a, b = map(int, input().split())
s = input()
s1=[]
for k in s:
    s1.append(k)
x=0
if s1[a+1-1]=='-':
    s1.remove(s1[a])
    for i in s1:
        if i not in ('0','1','2','3','4','5','6','7','8','9'):
            x=0
            break
        else:
            x=1
else:
    x=0
if x==0:
    print('No')
elif x==1:
    print('Yes')

Solution (Python):
import math
import sys
import re
def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

a = arr_data[0][0]
b = arr_data[0][1]
s = arr_data[1][0]



pattern="^[0-9]{" + a + "}-[0-9]{" + b + "}$"



if(re.search(pattern,s)):
    
    print("Yes")

else:
    
    print("No")

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

res = 'Yes'
if S[A] != '-' or len(S) != A+B+1:
    res = 'No'

else:
    for i in range(A):
        if not S[i] in '1234567890':

            res = 'No'
            break
    for i in range(B):
        if not S[A+i+1] in '1234567890':

            res = 'No'
            break
print(res)

Solution (Python):
import sys

stdin = sys.stdin

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

a,b = na()
s = ns()
flag = 1
if s[a] == "-":
    for i in s[:a]:
        if i == "-":
            flag = 0
            break
    if flag:
        for i in s[a+1:]:
            if i == "-":
                flag = 0
                break
else:
    flag = 0
if flag:
    print("Yes")
else:
    print("No")

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

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

for i in range(len(S)):
    if i+1 <= A and S[i]=='-':
        print('No')
        break
    elif i+1 == A+1 and S[i]!='-':
        print('No')
        break
    elif A+1 < i+1 and i+1 <= A+B+1:
        if S[i]=='-':
            print('No')
            break

else:
    print('Yes')

Solution (Python):
A, B = map(int, input().split())
S = input()
tr, fal = "Yes", "No"

def judge_post_code():
    if len(S) != A + B + 1:
        return fal
    if S[A] != "-":
        return fal
    for i in S[:A]:
        if not i in "0123456789":
            return fal
    for i in S[A+1:]:
        if not i in "0123456789":
            return fal
    return tr

print(judge_post_code())

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

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

arr=S.split("-")

if len(arr[0])==A:
    if len(arr[1])==B:
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

flag=True
if S[A]!='-':
    flag=False
a=S[:A]
b=S[A+1:]
if not(a.isdigit() and b.isdigit()):
    flag=False
if flag:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
if __name__ == "__main__":
    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")
            exit(0)
    print ("No")

Solution (Python):
line1 = input()
post1, post2 = map(int, line1.split())

postal_list = postal_code = input().split("-")

if len(postal_list) == 2:
    if post1 == len(postal_list[0]) and post2 == len(postal_list[1]):
        print ("Yes")
    else:
        print ("No")
else:
    print ("No")

Solution (Python):





if __name__ == '__main__':
    import re

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

    text = r'\d{' + A + '}\-\d{' + B + '}'
    result = re.match(text, S)

    if result:
        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[:a].isdigit() and s[a+1:].isdigit()):
    print("Yes")
else:
    print("No")

Solution (Python):
A, B = map(int, input().split())
S = input()
try :
    int(S[:A])
    int(S[B:])
except ValueError:
    print("No")
    exit()
if S[A] == "-":
    print("Yes")
    exit()
print("No")

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

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

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

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

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

if re.match(r'[0-9]{%s}-[0-9]{%s}' % (A,B),S):
    print("Yes")
else:
    print("No")

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

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

reString=r"^\d{"+A+"}-\d{"+B+"}$"
reCompiled=re.compile(reString)
if reCompiled.match(S):
	print("Yes")
else:
	print("No")

Solution (Python):


A, B = map(int, input().rstrip().split())
S = input()
n = [str(n) for n in range(10)]
fulfill = 1
for s in S[:A]:
    if s not in n:
        print("No")
        fulfill = 0
        break
if fulfill:
    if S[A] != "-":
        print("No")
        fulfill = 0
if fulfill:
    for s in S[A + 1:]:
        if s not in n:
            print("No")
            fulfill = 0
            break
if fulfill:
    print("Yes")

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

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

if not S[:A].isdigit():
    print("No")
    exit()

if not S[A+1:].isdigit():
    print("No")
    exit()

print("Yes")

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

Solution (Python):
a, b = map(int, raw_input().split())
s = raw_input().split('-')

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

Solution (Python):
import re
a,b = input().split()
ans = ["No", "Yes"]
print( ans[  re.match( '[0-9]{' + a + '}-[0-9]{' + b  + '}'  , input()) != None  ])

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

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

numbers = [str(i) for i in range(10)]

for i in range(A+B+1):
	if i == A:
		if S[i] != '-':
			print("No")
			exit(0)
	else:
		if S[i] not in numbers:
			print("No")
			exit(0)

print("Yes")

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

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

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

Solution (Python):
g = list(map(int,input().split()))
S = str(input())
 
if ((S[:g[0]]+S[g[0]+1:]).isdigit()) &  (S[g[0]]=="-"):
    print("Yes")
else:
    print("No")

Solution (Python):



import sys

def main():
    a, b = map(int, sys.stdin.readline().split())
    s = sys.stdin.readline().strip()

    for i, c in enumerate(s):
        if i != a:
            if c.isdigit() == True and 0 <= int(c) <= 9:
                continue
        elif c == '-':
            continue
        break
    else:
        print('Yes')
        sys.exit()

    print('No')

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import re
A,B = map(int,input().split(" "))
S = list(input())
judge=True
for i in range(len(S)):
    if i == A:
        if S[i] == "-":
            pass
        else:
            judge = False
    else:
        try:
            int(S[i])
        except:
            judge =False
if judge:
    print("Yes")
else:
    print("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):
def main():
    A, B = list(map(int, input().split()))
    S = input()

    for idx in range(len(S)):
        if idx == A:
            if S[idx] != "-":
                print("No")
                return

        else:
            if not S[idx].isdigit():
                print("No")
                return

    print("Yes")

main()

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

Solution (Python):
A, B = map(int, input().split())
S = input()
flag = True
if(len(S) != A + B + 1 or S[A] != '-'):
    print('No')
    flag = False
if(flag):
    for i in range(len(S)):
        if(i == A):
            continue
        if(S[i] < '0' or S[i] > '9'):
            print('No')
            flag = False
            break
if(flag):
    print('Yes')

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
            break
    else:
        if not (s[i] in list(map(str,range(10))) ):
            flag = False
            break
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
from collections import Counter

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

count = Counter(S)

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

Solution (Python):
def is_int(numstr):
    return all(map(lambda c: c in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], numstr))


def main():
    a, b = map(int, input().split())
    s = input()
    haifun = s[a]
    mae = s[:a]
    ushiro = s[-b:]
    if is_int(mae) and haifun == "-" and is_int(ushiro):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):


import sys

a, b = [int(e) for e in raw_input().split()]
s = raw_input().split()[0]

sa = s[:a]
sh = s[a:a+1]
sb = s[a+1:]

if len(sa) == a:
    if  sa.isdigit():
        if sh == '-':
            if len(sb) == b:
                if sb.isdigit():
                    sys.stdout.write('Yes\n')
                    sys.stdout.flush()
                    sys.exit(0)

sys.stdout.write('No\n')
sys.stdout.flush()

Solution (Python):

front,back = map(int,input().split())

test_code = list(input())

seikai = ["0","1","2","3","4","5","6","7","8","9"]
flag = True
 
if test_code[front] == "-":
    for x in range(front + back + 1):
        if x != front:
            if (test_code[x] in seikai) is False:
                flag = False
                break
else:
    flag = False
 
if flag == True:
    print("Yes")
else:
    print("No")

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

result = ""
if len(s)!=a + b + 1:
    result = "No"
elif s[a]!="-":
    result = "No"
else:
    for i in range(len(s)):
        if s[i] == "-" and i != a:
            result = "No"
        if s[i] != "-" and int(s[i]) not in range(0, 10):
            result = "No"
    if result !="No":
        result = "Yes"
print(result)

Solution (Python):

import re
a, b = map(int, input().split(' '))
pc = input()
pattern = '^\d{{{0}}}-\d{{{1}}}$'.format(a, b)
if re.match(r'{0}'.format(pattern), pc):
    print('Yes')
else:
    print('No')

Solution (Python):

"""
https://beta.atcoder.jp/contests/abc084/tasks/abc084_b

"""
import sys
from sys import stdin
import re
input = stdin.readline


def solve(A, B, S):
    result = 'No'
    pattern = r'^(\d{' + str(A) + '})-(\d{' + str(B) + '})$'
    m = re.search(pattern, S)
    if m:
        result = 'Yes'
    return result


def main(args):
    A, B = map(int, input().split())
    S = input().strip('\n')
    
    
    ans = solve(A, B, S)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

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

S = input()

pattern = re.compile(r'\d{%d}-\d{%d}' % (A, B))

if re.match(pattern, S):
    print('Yes')
else:
    print('No')

Solution (Python):
a,b = map(int,raw_input().split())
valid = True
s = raw_input()
for ind in range(len(s)):
        if ind == a:
            if s[ind] != "-":
                valid = False
        else:
            if s[ind].isalpha() or s[ind] == "-":
                valid = False        
if valid: print "Yes"
else: print "No"

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

def solve(a,b,s):
    
    if s[a] != '-':
        return 'No'

    cstring = s[:a] + s[a+1:a+b+1]
    
    for p in range(len(cstring)):
        if cstring[p].isdigit() != True:
            return 'No'
    return 'Yes'

print(solve(a,b,s))

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

flag = True

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

    if i is not a and s[i] == '-':
        flag = False


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

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

if s[A] == "-":
    s[A] = "1"
else:
    s[A] = "x"

S = "".join(s)
if S.isdigit():
    print("Yes")
else:
    print("No")

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

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

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

if S.count("-") != 1:
    print("No")
else:
    z, k = S.split("-")
    
    if len(z) == A and len(k) == B:
        print("Yes")
    else:
        print("No")