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

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 = map(int, input().split())
S = input()

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

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

T = list(S.strip().split('-'))

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

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

Solution (Python):
A, B = map(int, input().split(' '))
S = input()
N=0
if S[A] != '-':
    N=1
else:
    i=0
    while i < A:
        if S[i] in ['0','1','2','3','4','5','6','7','8','9']:
            i+=1
        else:
            N = 1
            break
    i+= 1
    while i < (A+B+1):
        if S[i] in ['0','1','2','3','4','5','6','7','8','9']:
            i+=1
        else:
            N = 1
            break
if N == 1:
    print('No')
else:
    print('Yes')

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

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

ans = False
if "-" in s:
    if s.count("-") == 1:
        sa, sb = s.split("-")
        if len(sa) == a and len(sb) == b:
            for i in sa+sb:
                if not i.isdigit():
                    break
            else:   
                ans = True
if ans:
    print("Yes")
else:    
    print("No")

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

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

Solution (Python):
import re

def validate(a, b, s):
    pattern = "\\d{%d}-\\d{%d}"%(a, b)
    
    m = re.match(pattern, s)
    return m is not None



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

Solution (Python):
A, B = map(int,input().split())
S = input()
result = "Yes"
if(A<=0 or B<=0 or A>5 or B>5 or S.count("-") != 1):
	result = "No"
else:
	T = S.split("-")
	if(not T[0].isdigit() or not T[1].isdigit()
	or len(T[0]) != A or len(T[1]) != B):
		result ="No"
print(result)

Solution (Python):
input_list = []
for i in range(2):
    input_list.append(input().split())
A = int(input_list[0][0])
B = int(input_list[0][1])
S = input_list[1][0]

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

def isThereHyphen():
  rslt = False
   
  if s[a] == "-":
    firstStr = (s.split("-"))[0]
    secondStr = (s.split("-"))[1]
    if((firstStr.isdigit() == True) and (secondStr.isdigit() == True)):
      rslt = True

  return rslt

def main():
  rslt = isThereHyphen()

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


main()

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

Solution (Python):
a, b = [int(i) for i in input().split()]
yubin = input()
answer = ''

for i in range(a):
    if yubin[i] == '-':
        answer = 'No'

if yubin[a] != '-':
    answer = 'No'

for i in range(a + 1, a + b + 1):
    if yubin[i] == '-':
        answer = 'No'

if answer == 'No':
    print('No')
else:
    print('Yes')

Solution (Python):

A, B = list(map(int, input().split()))
S = list(map(str, input().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 = raw_input().split()
s = raw_input()

print "Yes" if re.match("\d{"+A+"}-\d{"+B+"}", s) else "No"

Solution (Python):
import re

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

def main():
    pattern = r"[0-9]{{{0}}}-[0-9]{{{1}}}".format(A, B)
    ans = "Yes" if re.match(pattern, S) else "No"
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
import pdb


def main():
    AB = raw_input().split(' ')
    A = int(AB[0])
    B = int(AB[1])
    S = np.array(list(raw_input()))
    if checkpostal(S,A,B):
        print 'Yes'
    else:
        print 'No'

def checkpostal(S, A, B):
    integers = [str(k) for k in range(10)]
    checkpasses = True
    if len(S) !=  A + B + 1:
        return False

    for k in range(len(S)):
        if k == A:
            mypass = (S[k] == '-')
            checkpasses = checkpasses and mypass
        else:
            mypass = S[k] in integers
            checkpasses = checkpasses and mypass

    return checkpasses

if __name__ == '__main__':
    main()

Solution (Python):
import re
A,B=map(int,input().split())
print(["Yes","No"][re.match("\d{{{}}}-\d{{{}}}\Z".format(A,B),input())is None])

Solution (Python):
A,B = map(int,input().split())
S = input()
result = "Yes"
for i,s in enumerate(S):
    if i < A or A < i:
        if(s == '-'): 
            result =  "No"
            break
    else:
        if(s != '-'):
            result =  "No"
            break
print(result)

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

    S = S.split('-')
    if len(S) != 2:
        print('No')
        exit()

    a = S[0]
    b = S[1]

    if len(a) == A:
        if len(b) == B:
            print('Yes')
            exit()

    print('No')

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

f = S[:int(A)]
s = S[int(A)+1:]

if S[int(A)] == "-":
    if f.isdigit() and s.isdigit():
        ans = "Yes"
    else:
        ans = "No"
else:
    ans = "No"

print(ans)

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

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

Solution (Python):
import re
A, B = [x for x in input().split()]
print('Yes' if re.match('^[0-9]{' + A + '}-[0-9]{' + B + '}$', input()) else 'No')

Solution (Python):
import re

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

match = re.match('^[0-9]{' + str(A) + '}-[0-9]{' + str(B) + '}$', S)

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

Solution (Python):

num = input()
Num = num.split()
a = int(Num[0])
b = int(Num[1])


ad = input()
A = ad[:a]
s = ad[a]
B = ad[a+1:]

Alist = list(A)
Blist = list(B)

i = 0
j = 0
ca = "f"
cb = "f"
for i in range(10):
    for j in range(a):
        
        if str(i) == Alist[j]:
            ca = "t"
            break
    if ca == "t":
        break
for i in range(10):
    for j in range(b):
        
        if str(i) == Blist[j]:
            cb = "t"
            break
    if cb == "t":
        break

if ad[a] == "-" and ca == "t" and cb == "t":
    Al = len(A)
    Bl = len(B) 

    if a == Al and b == Bl :
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

    for i in s[0:a]:
        if '0' > i or i > '9':
            print("No")
            return
    if s[a] != '-':
        print("No")
        return
    for i in s[a+1:a+b+1]:
        if '0' > i or i > '9':
            print("No")
            return
    print("Yes")
    return

solve()

Solution (Python):
import re

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

regex = '[0-9]{'+str(A)+'}-[0-9]{'+str(B)+'}'
if( re.compile(regex).match(S) ):
    print("Yes")
else:
    print("No")

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


if s[a] == '-' and a + b + 1 == len(s):
    for i in range(len(s)):
        asc = ord(s[i])
        if a == i:
            continue
        if asc < 48 or asc > 57:
            print "No"
            sys.exit()
    print "Yes"
else:
    print "No"

Solution (Python):


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

ok = True

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

ok = ok and s[0:a].isdigit() and s[a+1:].isdigit()

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

Solution (Python):
def solve():
	A, B = list(map(int, input().split()))
	S = input()
	if len(S) != (A+B+1) or S[A] != "-" or not S[:A].isdigit() or not S[A+1:].isdigit():
		print("No")
		return
	else:
		print("Yes")
	
solve()

Solution (Python):
import re

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

if re.match(r"\d{%d}-\d{%d}"%(A, B), S):
    print("Yes")
else:
    print("No")

Solution (Python):
def suuji(S):
    for i in range(len(S)):
        if S[i]=="-":
            return False
    return True

def func(S,a,b):
    if S[a]=="-":
        S.pop(a)
        if suuji(S) and len(S)==a+b:
            return "Yes"
    return "No"


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

S=list(input())

print(func(S,a,b))

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

sliceA = S[0:A]
sliceB = S[A+1:A+B+1]

if sliceA.isdigit() and sliceB.isdigit() and S.find("-") == A and len(sliceA) == A and len(sliceB) == B:
    print("Yes")
else:
    print("No")

Solution (Python):





import sys

A, B = [int(w) for w in sys.stdin.readline().split()]
S = sys.stdin.readline().strip()

answer = True
answer = answer and (len(S) == A + B + 1)
answer = answer and (S[A] == '-')
answer = answer and all(c != '-' for c in S[:A] + S[A + 1:])

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

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

ret=True
for i in range(0,a):
  if not (s[i]=='0' or s[i]=='1' or s[i]=='2' or s[i]=='3' or s[i]=='4' or s[i]=='5' or s[i]=='6' or s[i]=='7' or s[i]=='8' or s[i]=='9'):
    ret=False
if not s[a]=='-':
  ret=False
for i in range(a+1,len(s)):
  if not (s[i]=='0' or s[i]=='1' or s[i]=='2' or s[i]=='3' or s[i]=='4' or s[i]=='5' or s[i]=='6' or s[i]=='7' or s[i]=='8' or s[i]=='9'):
    ret=False

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

Solution (Python):
import re
A,B = [int(i) for i in input().split()]
S = input()
count = 0
for i in range(A + B + 1) :
    if (S[A] != '-'):
        break
    elif (re.match("[0-9]",S[i])):
        count+=1
if count == (A + B):
    print('Yes')
else :
    print('No')

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

def check(a, b, s):
    if not len(s) == 2:
        return "No"

    former, latter = s[0], s[1]
    if not(len(former) == a and len(latter) == b):
        return "No"

    try:
        num_former = int(former)
        num_latter = int(latter)
        return "Yes"
    except ValueError:
        return "No"

print(check(a, b, s))

Solution (Python):
A,B=map(int, input().split())
S=input()
c=S.count('-')
if c==0 or 2<=c:
  print('No')
elif S[A]!='-':
  print('No')
else:
  print('Yes')

Solution (Python):
from pprint import pprint as pp
def GI(): return int(raw_input())
def GIS(): return map(int, raw_input().split())

def main():
  A, B = GIS()
  S = raw_input()
  print('Yes' if S[A] == '-' and all(map(str.isdigit, (S[:A], S[A+1:]))) else 'No')

main()

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

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

if __name__=="__main__":
    main()

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

Solution (Python):
strnum = [str(i) for i in range(10)]

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

S = input()

S = S.split("-")

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

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

    flag = True
    for i in range(len(address)):
        if i == a:
            if address[i] != '-':
                flag = False
                break
            else:
                continue
        try:
            tmp = int(address[i])
        except ValueError:
            flag = False
            break

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

if __name__ == '__main__':
    main()

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


cond = [True,True,True]
for i in range(A):
  if S[i] not in '0123456789':
    cond[0]=False
if S[A]!='-':
  cond[1]=False
for i in range(A+1,A+B+1):
  if S[i] not in '0123456789':
    cond[2]=False

if all(cond):
  print('Yes')
else:
  print('No')

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

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

if Ss[A] == '-' and Ss[:A].isnumeric() and Ss[A + 1:].isnumeric():
    print('Yes')
else:
    print('No')

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

ans = (len(S) == A+B+1)
for i,c in enumerate(S):
  if i == A:
    ans &= (c == '-')
  else:
    ans &= ('0' <= c <= '9')

print(['No', 'Yes'][ans])

Solution (Python):

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

try:
    int(s[:a])
    int(s[a+1])

except Exception:
    print('No')
    exit()

if s[a] == '-':
    print('Yes')

else:
    print('No')

Solution (Python):
a,b=map(int,input().split())
s=list(input())
a_i=s[0:a]
b_i=s[a+1:]
ans=""
for i in range(a):
    ans+=a_i[i]
for i in range(b):
    ans+=b_i[i]
if s[a]=="-" and ans.isdigit():
    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):
a, b = map(int, input().split())
s = input()

ok = len(s) == a + b + 1 and s[a] == '-' and s[:a].isdigit() and s[a+1:].isdigit()

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

Solution (Python):
import math
import itertools
import heapq
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque








def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_I(): return map(int, stdin)
def ALL_IL(): return LM(int,stdin)


def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))





def main():
	a,b = LI()
	s = input().split('-')

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


if __name__ == '__main__':
	main()

Solution (Python):
a, b = map(int, input().split())
s = input()
flag = 0
for i in range(len(s)):
    if i != a and s[i] == "-":
        flag = 1
    if i == a and s[i] != "-":
        flag = 1

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

Solution (Python):
import re
z=re.split('\s',input())
s=input()
print("Yes") if re.match("\d{"+z[0]+"}-\d{"+z[1]+"}",s) else print("No")

Solution (Python):



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

def check(arg):
    flag = True
    for i in arg:
        if i in "0123456789":
            flag = True
        else:
            flag = False
    return flag


cut_a = s[:a]
cut_b = s[a:a+1]
cut_c = s[a+1:a+1+b]


if check(cut_a) and cut_b == "-" and check(cut_c):
    print("Yes")
else:
    print("No")

Solution (Python):
a=(input()).split(' ')
S=input()

if S.count('-')!=1:
    print('No')
else:
    S=S.split('-')
    print('Yes' if (len(S[0])==(int)(a[0]) and len(S[1])==(int)(a[1]))else 'No')

Solution (Python):
import sys
from builtins import map
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache, reduce
from operator import xor
from heapq import heappush, heappop
INF = float("inf")
sys.setrecursionlimit(10**7)


dy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


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

    ans = "Yes"
    for i in range(A):
        if not S[i].isdigit():
            ans = "No"
    if S[A] != "-":
        ans = "No"

    for i in range(A + 1, A + B + 1):
        if not S[i].isdigit():
            ans = "No"
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import re

A, B = input().split()
postal_code = input()

def func(str1, str2, pcode):
    if pcode[int(str1)] != '-':
        return print('No')
    else:
        str_A, str_B = pcode[0:int(str1):], pcode[int(str1)+1::]

        if not re.match('[0-9]{1,}$', str_A):
            return print('No')
    
        if not re.match('[0-9]{1,}$', str_B):
            return print('No')
    
    return print('Yes')


if __name__ == '__main__':
    func(A, B, postal_code)

Solution (Python):
a, b = list(map(int,input().split()))
s = input()
from collections import Counter
c = Counter(s)
if (c["-"] == 1) & (s.find("-") == a):
    print("Yes")
else:
    print("No")

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

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

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

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

print("Yes")

Solution (Python):

from collections import Counter
a, b = map(int, input().split())
s = list(input())
c = Counter(s)
if len(s) == a+b+1:
    if c['-'] == 1 and s[a] == '-':
        print("Yes")
    else:
        print("No")
else:
    print("No")

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


if (len(S) == (A+B+1)) and (S[A] == '-') and (S.count('-') == 1) and len(re.findall('[0-9]', S)) == (A+B):
    print("Yes")
else:
    print("No")

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

if len(S) != A+B+1 or S[A] != '-':
    print("No")
else:
    try:
        a = int(S[0:A])
        b = int(S[A+1:A+B+1])
        print("Yes")
    except:
        print("No")

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

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

Solution (Python):

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

Solution (Python):
l = map(int, raw_input().split())
k = raw_input()
listed = list(k)
if (len(k) == (l[0] + l[1] + 1)) and (listed[l[0]] == "-"):
    if (str("".join(listed[0:l[0]])).isdigit() == True) and (str("".join(listed[l[0]+1:len(listed)])).isdigit() == True):
        print "Yes"
        exit()
    print "No"
else:
    print "No"

Solution (Python):
a,b=map(int,input().split())
s=str(input())
haihun=s[a]
number=s[:a]+s[a+1:]

ans=set(list(number))

if haihun=='-' and ans <= set(list('1234567890')):
    print('Yes')
else:
    print('No')

Solution (Python):
a, b = map(int, input().split())
s = input()
try:
    first, second = s.split("-")
    if len(first) == a and len(second) == b:
        print("Yes")
    else:  
        print("No")
except:
    print("No")

Solution (Python):
a,b=map(int,raw_input().split())
y=raw_input()
for i in range(len(y)):
	if i==a and y[i]!='-':
		print "No"
		exit(0)
	if i!=a and y[i] not in '0123456789':
		print "No"
		exit(0)
print "Yes"

Solution (Python):


import math
import sys

A,B = input().split(" ")
s = str(input())

s_sp = s.split("-")

if (len(s_sp) != 2):
    print("No")
    sys.exit()

if (len(s_sp[0]) != int(A)) | (len(s_sp[1]) != int(B)):
    print("No")
    sys.exit()

if ((s_sp[0].isdigit()) & (s_sp[1].isdigit())):
    print("Yes")
else:
    print("No")

Solution (Python):

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

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

if re.match(pattern, s):
    print("Yes")
else:
    print("No")

Solution (Python):



















import re

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

regex = "[0-9]{" + a + "}-[0-9]{" + b + "}"
match_res = re.fullmatch(regex, s)

ans = "No"
if(match_res != None):
   ans = "Yes"
print(ans)

Solution (Python):
import re

a, b = raw_input().split(" ")
s = raw_input()
 
pat = '^\d{' + a + '}-\d{' + b + '}$'
print "Yes" if (re.match(pat, s) is not None) else "No"

Solution (Python):

import sys

a,b=map(int,raw_input().split())
s=raw_input()
if s[a] != '-':
 print 'No'
 sys.exit()
for i in xrange(a):
 if s[i].isdigit()==False:
  print 'No'
  sys.exit()
for i in xrange(a+1,a+1+b):
 if s[i].isdigit()==False:
  print 'No'
  sys.exit()
print 'Yes'

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

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

if res == True:
	for i in range(len(S)):
		if i == A:
			continue
		else:
			if S[i] >= "0" and S[i] <= "9":
				continue
			else:
				res = False
				break

print("Yes" if res == True else "No")

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

    if s[a] != '-':
        return 'No'

    for p in [s[0:a],s[a+1:]]:
        for c in p:
            if not c.isdigit():
                return 'No'

    return 'Yes'

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

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

res = 'No'
sp = s.split('-')
if len(sp) == 2:
  if len(sp[0]) == a:
    res = 'Yes'
print(res)

Solution (Python):

 
a,b = map(int,raw_input().split())
s = raw_input()
flg = True

for i in range(0,a):
    if(not('0'<=s[i] and s[i]<='9')):flg = False
if(s[a] != '-'):flg = False
for i in range(a+1,a+b+1):
    if(not('0'<=s[i] and s[i]<='9')):flg = False
print('Yes' if flg else 'No')

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

    valid = False
    if S.count("-") == 1:
        s_a, s_b = S.split("-")
        if len(s_a) == A and len(s_b) == B:
            valid = True

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

if __name__ == '__main__':
    main()

Solution (Python):


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

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

else:
    Flag = 0
    for i in range(A):
        if (S[i] < '0' or S[i] > '9'):
            Flag = 1
            
    for i in range(A+1,len(S)):
        if (S[i] < '0' or S[i] > '9'):
            Flag = 1

    if Flag == 1:
        print "No"
    else:
        print "Yes"

Solution (Python):


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

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

else:
    Flag = 0
    for i in range(A):
        if (S[i] < '0' or S[i] > '9'):
            Flag = 1
            
    for i in range(A+1,len(S)):
        if (S[i] < '0' or S[i] > '9'):
            Flag = 1

    if Flag == 1:
        print "No"
    else:
        print "Yes"

Solution (Python):


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

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

else:
    Flag = 0
    for i in range(A):
        if (S[i] >= '0' and S[i] <= '9') == False:
            Flag = 1
            
    for i in range(A+1,len(S)):
        if (S[i] >= '0' and S[i] <= '9') == False:
            Flag = 1

    if Flag == 1:
        print "No"
    else:
        print "Yes"

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

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

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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b = LI()
    s = S()
    if len(s) != a+b+1:
        return 'No'
    for i in range(a):
        if not ('0' <= s[i] <= '9'):
            return 'No'
    if s[a] != '-':
        return 'No'
    for i in range(b):
        if not ('0' <= s[i+a+1] <= '9'):
            return 'No'

    return 'Yes'

print(main())

Solution (Python):
a,b = map(int,raw_input().split())
s = raw_input()
no = 0;
for i in range(len(s)):
	if i == a and s[i] != '-':
		no = 1;
	elif i != a and s[i] == '-':
		no = 1;

if no:
	print 'No'
else:
	print 'Yes'

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


try:
    s1,s2=s.split("-")
except Exception as e:
    print('No')
    sys.exit()

if(not s1.isdigit() or not s2.isdigit()):
    print('No')
    sys.exit()

if(len(s1)!=a or len(s2)!=b or len(s2)>5):
    print('No')
    sys.exit()

print('Yes')

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

flag = 0

for i in range(len(S)):
    if S[i] == '-':
        if i == A:
            flag = 1
        else:
            flag = 0
            break

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

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

Solution (Python):

num = list(map(int, input().split()))
string = input()
length = num[0] + num[1] + 1
flag = False

for i in range(num[0]):
    if string[i].isdigit():
        flag = True
    else :
        flag = False
        break

if string[num[0]] == '-' and flag:
    for i in range(num[0] + 1, length):
        if string[i].isdigit():
            flag = True
        else:
            flag = False
            break
else:
    flag = False

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

Solution (Python):
def check_int(num):
    try:
        int(num)
        return True
    except:
        return False

a, b = map(int, raw_input().split(" "))
s = raw_input().split("-")
if len(s) != 2:
    print 'No'
else:
    flag = True
    for i in s:
        if not check_int(i):
            flag = False
    if flag:
        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 = str(input())
ans = str(S[a])
l = len(S)
c = 0
wr = 0
while c < l:
    if c == a:
        if "-" != ans:
            wr = 1
            break
        else:
            c += 1
    else:
        if "-" == str(S[c]):
            wr = 1
            break
        else:
            c += 1
if wr == 1:
    print("No")
else:
    print("Yes")

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

Solution (Python):
a = list(map(int, input().split()))
b = input()
c = True
for i in range(a[0]):
    try:
        if 0 <= int(b[i]) <= 9:
            pass
    except:
        c = False
if b[a[0]] == "-":
    pass
else:
    c = False
for i in range(a[1]):
    try:
        if 0 <= int(b[i + a[0] + 1]) <= 9:
            pass
    except:
        c = False
if len(b) != a[0] + a[1] + 1:
    c = False
if c == True:
    print("Yes")
else:
    print("No")

Solution (Python):
import re
a,b = input().strip().split(" ")
a = int(a)
b = int(b)
s = str(input()).strip()
s_pattern='^[0-9]{{{a}}}-[0-9]{{{b}}}$'.format(a=a,b=b)
pattern = re.compile(s_pattern)
m = pattern.match(s)
if m:
    print("Yes")
else:
    print("No")

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

count = 0
if len(S_list) != A + B + 1:
  print("No")
else:
    if S_list[A] != "-":
      print("No")
    else:
      for i in S_list:
        if i == "-":
          count +=1
        else:
          continue
      if count == 1:
        print("Yes")
      else:
        print("No")

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

P=len(S)

X=0

for i in range(A):
    if S[i]!="-":
        X=X+1
        
if S[A]=="-":
       X=X+1
        
for i in range(A+1,B+A+1):
    if S[i]!="-":
        X=X+1

if X==P:
    print("Yes")
else:
    print("No")

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

for i in list(s):
    if i == '-':
        d += 1

try:
    map(int, s.split('-'))
    if len(s) == a + b + 1 and s[a] == '-' and d < 2:
        print('Yes')
    else:
        print('No')
except:
    print('No')

Solution (Python):


a, b = map(int, raw_input().split())

s = raw_input()
list = [ ]
list = s.split ( '-' )
if ( len(list[0]) == a and len(list[1]) == b):
    print "Yes"
    exit()
print "No"

Solution (Python):
ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]

s = list(input())
fff = "Yes"

for i in range(0, len(s)):
    if i == a:
        if s[i] != "-":
            fff = "No"
    else:
        if s[i] not in "0123456789":
            fff = "No"

print(fff)