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):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

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

cnt=0
for i in range(len(S)):
  if(S[i] == "-"):
    cnt+=1
if cnt > 1:
  print("No")
  exit()

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

Solution (Python):
import re
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b = iim()
s = input()

ma = re.match(r'\d{%s}' %a, s[:a])
mb = re.match(r'\d{%s}' %b, s[a+1:])

if s[a] == '-' and ma and mb:
    print('Yes')
else:
    print('No')

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

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

s = input()

if s.count("-") == 1:
  a, b = s.split("-")
  if len(a)==A and len(b)==B:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Solution (Python):

import re
import sys


YES = "Yes"  
NO = "No"  


def solve(A: int, B: int, S: str):
    print(YES if re.match(r"\d" * A + "-" + r"\d" * B, S) else NO)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    S = next(tokens)  
    solve(A, B, S)


if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())
list_S = list(input())
ans = "No"
if list_S[:a].count("-") == 0 and list_S[a+1:].count("-") == 0 and list_S[a] == "-":
    ans = "Yes"

print(ans)

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

if S[A] == "-":
    flag = True
    for i in range(len(S)):
        if i == A:
            continue
        if not S[i].isdecimal():
            flag = False
            break
    if flag:
        ans = "Yes"

print(ans)

Solution (Python):
url = "https://atcoder.jp/contests/abc084/tasks/abc084_b"

import re


def main():
    n, m = list(map(int, input().split()))
    s = list(input())
    if s[n] != '-':
        print('No')
        exit()
    else:
        s.pop(n)

    s = ''.join(s)
    pat = '^[0-9]+$'
    rep = re.compile(pat)
    result = rep.match(s)
    if result is not None:
        if result.group() == s:
            print('Yes')
            exit()
    print('No')



if __name__ == '__main__':
    main()

Solution (Python):
url = "https://atcoder.jp/contests/abc084/tasks/abc084_b"

import re


def main():
    n, m = list(map(int, input().split()))
    s = list(input())

    if s[n] != '-':
        print('No')
        exit()
    else:
        s.pop(n)
    s = ''.join(s)
    pat = '^[0-9]+$'
    rep = re.compile(pat)
    result = rep.match(s)
    if result is not None:
        if result.group() == s:
            print('Yes')
            exit()
    print('No')



if __name__ == '__main__':
    main()

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

Solution (Python):
A, B = map(int, input().split())
S = input()
f1 = S[:A].isdecimal()
f2 = S[A] == "-"
f3 = S[A+1:].isdecimal()
if f1 and f2 and f3:
  print("Yes")
else:
  print("No")

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

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

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

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

Solution (Python):

import sys
input = sys.stdin.readline











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

sa,sb = S[:A],S[A+1:]
cond = sa.count("-") == 0 and sb.count("-") == 0 and S[A] == "-"
print("Yes" if cond else "No")

Solution (Python):
def f(s):
    return all(i in '0123456789' for i in s)
a, b = map(int, input().split())
s = input()
print('Yes' if f(s[:a]) and f(s[-b:]) and s[a]=='-' else 'No')

Solution (Python):




"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 

 


 
 
 
def main():
  a,b = map(int,input().split())
  s = input()
  
  if s.count('-') == 1 and s[a] == '-':
    print('Yes')
  else:
    print('No')
  
if __name__ == '__main__':
  main()

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

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

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

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())
S = str(input())

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

Solution (Python):
a,b=map(int,input().split())
s=input()
def dig(s):
    if "0"<=s<="9":
        return True
    else: return False

def dig2(s,a,b):
    for i in s[:a]:
        if not dig(i):
            return False
    if s[a]!='-':
        return False

    for i in s[a+1:]:
        if not dig(i):
            return False
    return True

print(["No","Yes"][dig2(s,a,b)])

Solution (Python):
a,b=map(int,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()

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

Solution (Python):

import sys
import itertools
import fractions
import copy
import bisect
import math

from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter


N=3
M=3
i=0
j=0
k=0
n=3
r=1
a=[0]*5
b=["0","1", "2", "3", "4", "5", "6", "7", "8", "9"]
c=[]
A,B=map(int, input().split())







"1行1つの整数を入力を取得し、整数と取得する"
s=input()
a=[i for i in s]
if a[A]!="-":
    print("No")
    sys.exit()


for i in range(A):
    
    if not a[i] in b:
         print("No")
         sys.exit()

for i in range(B):
    
    if not a[i+A+1] in b:
         print("No")
         sys.exit()

print("Yes")

"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

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

Solution (Python):
import re


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

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

Solution (Python):
import re

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

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


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

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

if not s[:a].isdecimal():
        print("No")
        exit()
if s[a] != "-":
        print("No")
        exit()
if not s[a+1:].isdecimal():
        print("No")
        exit()
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 = map(int, input().split())
print('Yes' if re.match(r'\d{{{}}}-\d{{{}}}'.format(a, b), input()) else 'No')

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

for i in range(len(s)):
    if i + 1 <= a or i - 1 >= a:
        if not s[i].isdigit():
            ans = "No"
            break
    else:
        if s[i] != "-":
            ans = "No"
            break

print(ans)

Solution (Python):
import math

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

t=s.partition("-")


if s[a]=='-' and t[0].isnumeric() and t[2].isnumeric():
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
from sys import exit
num = ["0","1","2","3","4","5","6","7","8","9"]
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] not in num:
      print("No")
      exit()
print("Yes")

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

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

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


if __name__ == "__main__":
    main()

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

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

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

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

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

print('Yes')

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

for i in range(len(s)):
  if i==a:
    if s[a]=="-":
      count+=1
  else:
    if 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":
      count+=1
      
print("Yes"if count==len(s) else"No")

Solution (Python):
import sys

A, B = map(int, input().split())
S = input()
l = ["0","1","2","3","4","5","6","7","8","9"]
if S[A] != "-":
    print("No")
    sys.exit()
for i in range(len(S)):
    if i == A:
        continue
    elif S[i] not in l:
        print("No")
        sys.exit()
print("Yes")

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

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

Solution (Python):
N, M = map(int, input().split())
S = input()

S = S.split('-')
ans = 'No'
if len(S)==2 and len(S[0])==N and len(S[1])==M:
  ans = 'Yes'

print(ans)

Solution (Python):
a,b=map(int,input().split())
s=input()
flag1=True
if s[a]!='-':
    flag1=False
flag2=True
for i in range(0,len(s)):
    if i==a:
        continue
    if not (s[i]>='0' and s[i]<='9'):
        flag2=False
print('Yes') if flag1 and flag2 else print('No')

Solution (Python):
import re
a,b = map(int,input().split())
s = input()
if s[a]=='-' and re.match(r'^\d+$',s[:a]) and re.match(r'^\d+$',s[a+1:]):
    print('Yes')
else:
    print('No')

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

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

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

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

ans=True
for i in range(A+B+1):
	if i==A :
		if S[i]!='-':
			ans=False
	elif S[i]=='-':
		ans=False

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

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

ok = True

for i in range(a + b + 1):
    if i != a:
        if not s[i].isdigit():
            ok = False
    else:
        if s[i] != '-':
            ok = False
if ok:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
def no():
    print("No")
    sys.exit()

a,b=map(int,input().split())
s=input()
num=[str(i) for i in range(10)]

if len(s)==a+b+1:
    for i in range(a):
        if s[i] not in num: no()
    if s[a]!="-": no()
    for i in range(a+1,a+b+1):
        if s[i] not in num: no()   

else: no()

print("Yes")

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

ans="Yes"
for i in range(0,A):
  if S[i]=="-":
    ans="No"
if S[A]!="-":
  ans="No"
for j in range(A+1,A+B+1):
  if S[j]=="-":
    ans="No"
    
print(ans)

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

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

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

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

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

Solution (Python):
import math
import string


def readints():
    return list(map(int, input().split()))


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


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

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

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

slist = list(s)
if not slist.count('-') == 1:
  print('No')
else:
  if slist[a] == '-':
    print('Yes')
  else:
    print('No')

Solution (Python):
import sys

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

if len(ss) != (a+b+1):
  print("No")
  sys.exit()


nums=["0","1","2","3","4","5","6","7","8","9"]

for i in range(len(ss)):
  if i==a:
    if ss[i]!="-":
      print("No")
      sys.exit()
  elif ss[i] not in nums:
    print("No")
    sys.exit()
print("Yes")

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

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

Solution (Python):
A, B = map(int, input().split())
S = input()
l = "0123456789"
cnta = 0
cntb = 0
if S[A] != "-":
    print("No")

else:
    for i in S[:A]:
        if l.count(i) == 1:
            cnta += 1
    
    for j in S[A + 1:]:
        if l.count(j) == 1:
            cntb += 1
    if cnta == A and cntb == B:
        print("Yes")
    else:
        print("No")

Solution (Python):
a,b=map(int,input().split())
s=input()
if s[a] != '-':
    print('No')
    quit()
left=s[:a]

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

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

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

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

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

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

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

Solution (Python):
a,b = map(int, input().split())
s = list(input())
flg = True
for i in range(a+b+1):
    if(i!=a and s[i]=='-'):
        flg = False
        break
    elif(i==a and s[i]!='-'):
        flg = False
        break

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

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

ans = "Yes"
if len(S) != A+B+1:
  ans = "No"
for i, s in enumerate(S):
  if i == A:
    if s != '-':
      ans = "No"
  else:
    if not '0' <= s <= '9':
      ans = "No"
print(ans)

Solution (Python):
A,B = [int(i) for i in input().split()]
S = input()
aa = S[:A]
bb = S[A+1:]
if str.isdigit(aa) and str.isdigit(bb) and S[A] == '-':
    print("Yes")
    exit()
print("No")

Solution (Python):
A,B=map(int,input().split())
S=input()
number=0
list=['0','1','2','3','4','5','6','7','8','9']
for a in range(A):
    if S[a] in list:
        number+=1
if S[A]=='-':
    number+=1
for a in range(B):
    if S[A+a+1] in list:
        number+=1
if number==A+B+1:
    print('Yes')
else:
    print('No')

Solution (Python):
import re
a, b = map(int, input().split())
print("Yes" if re.search("\d{{{}}}-\d{{{}}}".format(a, b), input()) else "No")

Solution (Python):
import re
a, b = map(int, input().split())
print("Yes" if re.search(r"\d{{{}}}-\d{{{}}}".format(a, b), input()) else "No")

Solution (Python):

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

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

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

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

import string

A, B = na()
S = ns()

flag = True
for i in range(len(S)):
    if i == A:
        if S[i] != '-':
            flag = False
    else:
        if S[i] not in string.digits:
            flag = False

print("Yes" if flag else "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]=="-":
			print("No")
			exit()
print("Yes")

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

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

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

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

if s.count("-") == 1:
    print("YNeos"[s.index("-")!=a or len(s)!=a+1+b::2])
else:
    print("No")

Solution (Python):








def resolve():

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

    for i in range(len(s)):
        if i==a:
            if s[i]!='-':
                print('No')
                break
        elif i!=len(s)-1:
            try:
                int(s[i])
            except:
                print('No')
                break
        else:
            print('Yes')



resolve()

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

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

Solution (Python):
import re

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

pattern = r"\d{" + a + r"}-\d{" + b + r"}"

result = re.match(pattern, s)

if result:
    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 and '-' != s[i]:
        continue
    elif  a < i and i < a+b+1 and '-' != s[i]:
        continue
    elif i == a and '-' == s[i]:
        continue
    else:
        print('No')
        exit()
print('Yes')

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

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

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

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

Solution (Python):
a, b = map(int, input().split())
s = list(input())
num = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
cnt = 0
if s[a] != "-":
  print("No")
  exit()
else:
  s.pop(a)
for i in s:
  for j in num:
    if i == j:
      cnt += 1
if cnt != len(s):
  print("No")
  exit()
print("Yes")

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

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


if s[a]!='-':
            print('No')
            exit()
r = s[:a]
v= s[a+1:]
for i in range(len(r)):
            if str(r[i]).isdigit()==False:
                        print('No')
                        exit()
for i in range(len(v)):
            if str(v[i]).isdigit()==False:
                        print('No')
                        exit()
print('Yes')

Solution (Python):
a, b = [int(x) for x in input().split()]
num = '0123456789'
S = input()
flg = True
for i in range(len(S)):
  if i == a:
    if not S[i] == '-':
      flg = False
  else:
    if not S[i] in num:
      flg = False
print('Yes' if flg else 'No')

Solution (Python):
import math
import itertools
import statistics

a, b = list(map(int, input().split()))
s = input()
for i in range(len(s)):
    if i==a and s[i]!="-":
        print("No")
        exit()
    if i!=a and (s[i]!="0" and s[i]!="1" and s[i]!="2" and s[i]!="3" and s[i]!="4"
    and s[i]!="5" and s[i]!="6" and s[i]!="7" and s[i]!="8" and s[i]!="9"):
        print("No")
        exit()
print("Yes")

Solution (Python):


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

Solution (Python):
a,b = map(int,input().split())
c = list(input())
ans = True
for i in range(a+b+1):
  if not((i==a and c[i]=="-") or (i!=a and c[i]!="-")):
    ans = False
    break
print("Yes" if ans else "No")

Solution (Python):

def Postal_Code(a , b , s):

    ans = "No"

    if s[:a].isdecimal() and s[a+1:].isdecimal() and s[a] == '-':
        ans = "Yes"

    return ans

def main():
    a , b = map(int , input().split())
    s = str(input())
    print(Postal_Code(a , b , s))

if __name__ == '__main__':
    main()

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

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

    if s[a:a+1] != '-':
        print('No')
    elif len(s) > a + b + 1:
        print('No')
    else:
        s2 = s[:a] + s[a+1:a+b+1]
        if  all([48 <= ord(str(c)) <= 57  for c in s2]):
            print('Yes')
        else:
            print('No')

main()

Solution (Python):
A,B=map(int,input().split())
S=input()
cnt=0
for i in range(len(S)):
    if(S[i]=='-'):
        cnt+=1
if(cnt>1 or cnt<1):
    print("No")
    exit()
Sl,Sr=S.split('-')
if(len(Sl)==A and len(Sr)==B):
    print("Yes")
else:
    print("No")

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

code = input()

def isInt(c):
    try:
        int(c)
        return True
    except ValueError:
        return False

for i, c in enumerate(code):
    if i == a:
        if c != '-':
            print('No')
            exit()
    else:
        if not isInt(c):
            print('No')
            exit()

print('Yes')

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

sa =S[:a]
sb =S[a+1:]

x = S[a]

if x != "-":
  print("No")
  exit()
  
  
if sa.isdigit() and sb.isdigit():
  print("Yes")
else:
  print("No")

Solution (Python):

a,b=map(int,input().split())
s=input()
flg=True
for i in range(a+b+1):
    if i==a:
        if s[i]!='-':
            flg=False
    else:
        if s[i] not in '0123456789':
            flg=False

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

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

for i in range(a+b+1):
    if a == i:
        if s[i] == "-": 
            continue
        else:
            print("No")
            break
    if s[i] not in c:
        print("No")
        break
else:
    print("Yes")

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

Solution (Python):
def main():
    A, B = map(int, input().split())
    S = list(input())
    ans = "Yes"
    for i, c in enumerate(S):
        if i < A and c == "-":
            ans = "No"
            break
        elif i == A and c != "-":
            ans = "No"
            break
        elif i > A and c == "-":
            ans = "No"
            break
    print(ans)


if __name__ == '__main__':
    main()

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

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

S = S.replace("-","",1)
if S.isdecimal() :
    print("Yes")
else :
    print("No")

Solution (Python):
a,b = map(int,input().split())
c = input()
if c[a] == "-" and c.count("-") == 1:
    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):


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

if S.count("-") == 1:
  s1,s2=S.rstrip().split("-")
  print( "Yes" if len(s1)==A and len(s2)==B else "No" )
else:
  print("No")

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

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


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

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

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

if len(content) == a + b + 1:
    A = content[:a]
    B = content[-b:]
    hyphn = content[a]
    if A.isdecimal() and B.isdecimal() and hyphn == '-':
        print('Yes')
    else :
        print('No')

Solution (Python):
import re
a, b = map(str, input().split())
s = input()
ptn = '^\d{' + a + '}-\d{' + b + '}'
if re.search(ptn, s):
    print('Yes')
else:
    print('No')