Problem:
 Score : 200 points    Problem Statement The postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1) -th character is a hyphen - , and the other characters are digits from 0 through 9 .  You are given a string S . Determine whether it follows the postal code format in Atcoder Kingdom.      Constraints  1≤A,B≤5  |S|=A+B+1  S consists of - and digits from 0 through 9 .         Input Input is given from Standard Input in the following format:  A  B  S       Output Print Yes if S follows the postal code format in AtCoder Kingdom; print No otherwise.        Sample Input 1 3 4
269-6650      Sample Output 1 Yes  The (A+1) -th character of S is - , and the other characters are digits from 0 through 9 , so it follows the format.       Sample Input 2 1 1
---      Sample Output 2 No  S contains unnecessary - s other than the (A+1) -th character, so it does not follow the format.       Sample Input 3 1 2
7444      Sample Output 3 No

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

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

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

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

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

Solution (Python):
a, b = map(int, input().split())
s = input()
flg = True
for i in range(a):
    if s[i] == '-':
        flg = False
if s[a] != '-':
    flg = False
for i in range(a + 1, a + b + 1):
    if s[i] == '-':
        flg = False
if flg:
    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):
A,B=map(int, input().split())
s=input()

ng = 0
if not (s[0:A].isdecimal()):
  ng = 1
if s[A] != "-": ng = 1
if not (s[A+1:A+B+1].isdecimal()):
  ng = 1
if ng == 1:
  print("No")
else:
  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 = 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].isdigit() and S[-B:].isdigit() and S[A] == '-':
    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()
digits = set([str(i) for i in range(10)])

for i in range(a+b+1):
    if i == a and S[i] != '-':
        print('No')
        break
    elif i == a and S[i] == '-':
        continue

    if not S[i] in digits:
        print('No')
        break
else:
    print('Yes')

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

c1 = S[A] == '-'
c2 = S[:A].isdecimal()
c3 = S[A+1:].isdecimal()
print('Yes' if c1 and c2 and c3 else 'No')

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

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

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

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

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

Solution (Python):
import sys
A, B = list(map(int, input().split()))
S = str(input())
flag = 0

if S[A] != "-":
  print("No")
  sys.exit()
else:
  for i in range(0,A):
    if 48 <= ord(S[i]) <= 57:
      flag = flag + 0
    else:
      flag = flag + 1
  for i in range(A+1,A+B+1):
    if 48 <= ord(S[i]) <= 57:
      flag = flag + 0
    else:
      flag = flag + 1
if flag != 0:
  print("No")
else:
  print("Yes")

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

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

Solution (Python):
A, B = map(int, input().split())
S = input()
try:
    int(S[:A]+S[A+1:])
    try:
        int(S)
        print("No")
    except:
        print("Yes")
except:
    print("No")

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

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

Solution (Python):
def resolve():
    A, B = list(map(int, input().split()))
    S = str(input())
    import re
    if S[A] != '-':
        print('No')
        return
    if re.match('[0-9]+', S[:A]) and re.match('[0-9]+', S[A+1:]):
        print('Yes')
        return

    print('No')


resolve()

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


def read():
    A, B = map(int, input().strip().split())
    S = input().strip()
    return A, B, S


def solve(A, B, S):
    return "Yes" if S.count("-") == 1 and S[A] == "-" else "No"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

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

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

s = list(input())

if len(s) != a+b+1:
  print("No")
else:
  for i in range(a):
    if s[i] == "-":
      print("No")
      exit()
  if s[a] != "-":
    print("No")
    exit()
  for j in range(a+1,a+b+1):
    if s[j] == "-":
      print("No")
      exit()
print("Yes")

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

main()

Solution (Python):

import sys
from collections import defaultdict, deque




def solve():
    a, b = [int(x) for x in input().split()]
    s = input()
    if s[a] == '-' and s.count('-') == 1:
        print("Yes")
    else:
        print("No")
        
t = 1

for case in range(1,t+1):
    ans = solve()



"""

1 4
7
RRRR
1 1 0 1
----
4

1 4
47
RCRR
1 1 0 1
----
-1

2 2
10
RR
RR
1 7
4 1
----
4

2 2
10
RR
RR
7 4
7 4
----
-1

3 3
8
RCR
RRC
RRR
1 1 1
1 1 1
1 3 1


3 3
1
RCR
RRC
RRR
1 1 1
1 1 1
1 3 1


"""

Solution (Python):
a,b = map(int,input().split())
s = input()
ans = ["0","1","2","3","4","5","6","7","8","9"]
ch1 = list(map(str,s[:a]))
if a > b:
    ch2 = list(map(str,s[a+b:]))
else:
    ch2 = list(map(str,s[a+1:]))
count = 0
for i in range(len(ch1)):
    if ch1[i] not in ans:
        count +=1
for j in range(len(ch2)):
    if ch2[j] not in ans:
        count += 1
if count == 0 and s[a] == "-":
    print("Yes")
else:
    print("No")

Solution (Python):
a,b = map(int,input().split())
s = input()
ans = ["0","1","2","3","4","5","6","7","8","9"]
ch1 = list(map(str,s[:a]))
ch2 = list(map(str,s[a+1:]))
count = 0
for i in range(len(ch1)):
    if ch1[i] not in ans:
        count +=1
for j in range(len(ch2)):
    if ch2[j] not in ans:
        count += 1
if count == 0 and s[a] == "-":
    print("Yes")
else:
    print("No")

Solution (Python):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b = i2()
s = s()
if "-" in s[0:a] or "-" in s[a+1:] or s[a] != "-":
	print("No")
else:
	print("Yes")

Solution (Python):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b = i2()
s = s()
ls = [str(i) for i in range(10)]

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

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

Solution (Python):
import math
from collections import deque
from collections import defaultdict

import bisect



def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): 
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): 
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} 
def bitArr(n):
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): 
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b = readInts()
s = readChar()

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

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

if s[a] != '-':
  print('No')
  exit()
elif '-' in s[:a-1]:
  print('No')
  exit()
elif '-' in s[a+1:]:
  print('No')
  exit()
else:
  print('Yes')

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

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

Solution (Python):






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





flag = True
for x in S[:A]:
    if x == "-":
        flag = False
        break
if flag:
    for x in S[A+1:]:
        if x == "-":
            flag = False
            break
if flag:
    if S[A] != "-":
        flag = False
if flag:
    print("Yes")
else:
    print("No")

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

if ('-' not in S[:A]) and ('-' == S[A]) and('-' not in S[A+1:]):
  print('Yes')
else:
  print('No')

Solution (Python):
a,b=map(int,input().split())
num=list(input())
non=False

for (i,c) in zip(range(0,a+b+1),num):
  if c=="-":
    if i==a:
      continue
    else:
      non=True
      break
  elif i==a:
    non=True
    break
    
if non:
  print("No")
else:
  print("Yes")

Solution (Python):
a,b = map(int,input().split())
s = list(input())
t1 = s[:a]
t2 = s[a]
t3 = s[a+1:]

t1 = ''.join(t1)
t3 = ''.join(t3)

def is_int(s):
    try:
        int(s)
        return True
    except ValueError:
        return False

if is_int(t1) == True and is_int(t3) == True and t2 == '-':
    print('Yes')
else:
    print('No')

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

if len(s)!=a+b+1:
  frag='No'
else:
  if s[a]!='-':
    frag='No'
  elif s[:a].isdecimal()==False:
    frag='No'
  elif s[a+1:].isdecimal()==False:
    frag='No'
    
print(frag)

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

Solution (Python):
def solve():
    A,B = map(int,input().split())
    S = input()
    seq = [str(x) for x in range(10)]

    for i in range(A+B+1):
        if i== A:
            if S[i] != "-":
                return False
        else:
            if not(S[i] in seq):
                return False
    return True

if __name__ == '__main__':
    cond = solve()
    if cond:
        print("Yes")
    else:
        print("No")

Solution (Python):




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


is_a_dec = str.isdecimal(s[0:a])
is_b_dec = str.isdecimal(s[a+1:len(s)])
is_hy = (s[a] == '-')

if is_a_dec and is_b_dec and is_hy:
    ans = 'Yes'
else:
    ans = 'No'


print(ans)

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

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

Solution (Python):

def resolve():
    a, b = map(int, input().split())
    s = input()
    if s.count("-") != 1:
        print("No")
        return

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

if __name__ == "__main__":
    resolve()

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

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and not '-' in s[a + 1:]:
    flag2 = True

if flag1 and flag2:
    print('Yes')
else:
    print('No')

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

if idx == a and count == 1:
    print("Yes")
else:
    print("No")

Solution (Python):
a, b = (int(i) for i in input().split())
s = input()
for i in range(a+b+1):
    if i == a:
        if not s[i] == '-':
            print('No')
            exit()
    else:
        if not s[i] >= '0' or not s[i] <= '9':
            print('No')
            exit()
print('Yes')

Solution (Python):

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

mae = s[:a]
usiro = s[a+1:a+b+1]


if mae.isdecimal() and usiro.isdecimal() and s[a] == '-':
    print('Yes')
else:
    print('No')

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

Solution (Python):
import re

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

p = r"^[0-9]{" + A + r"}-[0-9]{" + B + "}$"

if re.fullmatch(p, S):
    print("Yes")
else:
    print("No")

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

Solution (Python):
import sys

input = sys.stdin.readline


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

    is_valid = True
    for s in S[:A]:
        if s not in "0123456789":
            is_valid = False
    if S[A] != "-":
        is_valid = False
    for s in S[A + 1:]:
        if s not in "0123456789":
            is_valid = False

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


if __name__ == "__main__":
    main()

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

Solution (Python):
import re

def li():
    return list(map(int, input().split()))
def mi():
    return map(int, input().split())
def ii():
    return int(input())
def lim(N):
    return [int(input()) for i in range(N)]

A, B = mi()
S = input()

pattern = "[0-9]+"
c = re.compile(pattern)

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(A: int, B: int, S: str):
    is_mid = True if S[A] == "-" else False
    is_num = (S[:A] + S[A + 1 :]).find("-") == -1
    print(YES if is_mid and is_num 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):

import sys

YES = "Yes"  
NO = "No"  


def solve(A: int, B: int, S: str):
    is_hyphen = True if S[A : A + 1] == "-" else False
    before = S[:A]
    after = S[A + 1 :]
    try:
        int(before)
        int(after)
        if is_hyphen:
            print(YES)
        else:
            print(NO)
    except:
        print(NO)

    return



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

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

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

Solution (Python):
A,B=map(int,input().split())
S=input()
for s in S[:A]:
    if s not in "0123456789":
        print("No")
        exit()
if S[A]!="-":
    print("No")
    exit()
for s in S[A+1:]:
    if s not in "0123456789":
        print("No")
        exit()
print("Yes")

Solution (Python):
import re
A, B = map(int, input().split())
S = input()
c1 = re.search(r"\D", S[:A] + S[-B:]) is None
c2 = S[A] == "-"
print("Yes" if c1 and c2 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 = list(map(str, input().split("-")))
if len(S) != 2:
    print('No')
elif len(S[0]) == A and len(S[1]) == B:
    print("Yes")
else:
    print('No')

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

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

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

    for i in range(len(S)):
        if  S[i]!='-' and i<A and int(S[i])>=0 and int(S[i])<=9:
            f+=0
        elif i == A and S[i] =='-':
            f-=1
        elif S[i]!='-' and int(S[i])>=0 and int(S[i])<=9:
            f+=0
        else:
            f+=1

    if f==0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':

    ABC_84_B()

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())

    def made_of_digits(s):
        """
        Args:
            s (str)
        """
        
        digits = set(map(lambda x: str(x), range(10)))
        for char in s:
            if char not in digits:
                return False
        return True


    n, m = mi()
    s = input()
    print('Yes') if len(s) == n + m + 1 and made_of_digits(s[:n]) and s[n] == '-' and made_of_digits(s[n+1:]) else print('No')


if __name__ == "__main__":
    main()

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

def judge(S):
	if S[A] != "-":
		return False
	if len(S) != A+B+1:
		return False

	S = S[:A] + S[A+1:]

	if not S.isdigit():
		return False
	return True

print("Yes") if judge(S) 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() and len(s) == a + b + 1:
    print("Yes")
else:
    print("No")

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

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

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

flag = True
for i in range(a + b + 1):
    if i == a:
        if s[i] != "-":
            flag = False
    else:
        if not s[i].isdecimal():
            flag = False

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

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

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

Solution (Python):
A, B=map(int, input().split())
s=input()
c1=s[A]=="-"
c2="-" not in s[:A]
c3="-" not in s[A+2:]
if c1 and c2 and c3:
  print("Yes")
else:
  print("No")

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

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

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

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

Solution (Python):
a,b = map(int,input().split())
S = input()
flag = 0
if S[a] != "-":
    flag += 1
for i in range(0,a):
    if S[i]== "-":
        flag += 1
for i in range(a+1,a+b+1):
    if S[i] == "-":
        flag += 1
if flag == 0:
    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()

ans = 'Yes'

length = len(s)

for x in range(length):
    if x == a:
        if s[x] != '-':
            ans = 'No'
            break
        else:
            continue

    if ('0' > s[x] and s[x] > '9') or s[x] == '-':
        ans = 'No'
        break

print(ans)

Solution (Python):
import re


A, B = input().split()
print('Yes') if re.fullmatch(r'[0-9]{' + A + r'}-[0-9]{' + B + r'}', input()) else print('No')

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

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

Solution (Python):

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

checkset = [str(x) for x in range(10)]

def main():
    SA = S[:A]; SB = S[A+1:]
    for i in SA:
        if i not in checkset:
            print('No')
            return

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

    for i in SB:
        if i not in checkset:
            print('No')
            return

    print('Yes')

if __name__ == "__main__":
    main()

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

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

if S[A] == "-":
  for i in range(0,A):
    if 48<=ord(S[i])<=57:
      
      continue
    else:
      flag += 1
      break
  for i in range(A+1,A+B+1):
    if 48<=ord(S[i])<=57:
      continue
    else:
      flag += 1
      break
else:
  flag += 1
if flag == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
A,B = map(int,input().split())
S = list(input())
flag = True
num = ['0','1','2','3','4','5','6','7','8','9']

for i in range(A+B+1):
    if i != A:
        if S[i] not in num:
            flag = False
            break
    else:
        if S[i] != '-':
            flag = False
            break

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

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

Solution (Python):
import re

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

pattern = r'^\d{}-\d{}$'.format('{' + str(A) + '}', '{' + str(B) + '}')

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

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

numbers = {str(n) for n in range(10)}


def resolve(s):
    for i in range(A):
        if s[i] not in numbers:
            print('No')
            return

    if s[A] != '-':
        print('No')
        return

    s = s[A + 1:]
    for i in range(B):
        if s[i] not in numbers:
            print('No')
            return

    print('Yes')


resolve(S)

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

num = list(map(str, range(0, 10)))

ans = 'No'

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

print(ans)

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

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

num_list = list(map(str, range(0,10)))

flag = True

if s[a] == "-" and all([ c in num_list for c in list(s[:a]+s[a+1:]) ]):
    print("Yes")
else:
    print("No")

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

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

if s[a] != '-':
	f=False
	print('No')

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

Solution (Python):
a, b = map(int, input().split())
s = input()
try:
  ac, bc = int(s[:a]), int(s[a + 1:])
  flag = True
except ValueError:
  flag = False
print('Yes' if flag and s[a] == '-' else 'No')

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

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

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

for i in range(a):
    if not '0' <= s[i] and s[i] <= '9':
        print('No')
        exit()

if s[a] != '-':
    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 = input()
s_list = s
s_list = list(s_list)
num = ['0','1','2','3','4','5','6','7','8','9']
flg = False
cnt = 0

for i in range(len(s_list)):
    if i == a:
        if s_list[i] != '-':
            print('No')
            exit()
    elif s_list[i] not in num:
        print('No')
        exit()
print('Yes')

Solution (Python):


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


S= str(input())

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


    elif S[i].isdigit() == False:
        print('No')
        exit()


print('Yes')

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

def ifnum(v):
  for i in range(0,len(v)):
    if(v[i] == "0" or v[i] == "1" or v[i] == "2" or v[i] == "3" or v[i] == "4" or v[i] == "5" or v[i] == "6" or v[i] == "7" or v[i] == "8" or v[i] == "9"):
      continue
    else:
      return 0
  return 1


if(ifnum(s[0:a]) == 1 and s[a] == "-" and ifnum(s[a+1:]) == 1):
  print("Yes")
else:
  print("No")

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

Solution (Python):
A, B = map(int, input().split())
S = input()
N = set(map(str, range(10)))

L = set(S[:A])
M = S[A]
R = set(S[-B:])

if (L | R) <= N and M == '-':
    print('Yes')
else:
    print('No')

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

erro = 0

for i in range(A):
  if S[i] == '-':
    erro += 1
    
if S[A] != '-':
  erro += 1
  
for _ in range(A+1,A+B+1):
  if S[_] == '-':
    erro += 1

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

Solution (Python):
def instr():
    s = input()
    return(list(s[:len(s)]))



def invr():
    return(map(int, input().split()))


a, b = invr()
s = instr()

check = "1234567890-"
res = "Yes"

n = len(s)
if n != a+b+1:
    res = "No"
if s[a] != "-":
    res = "No"
for i in range(n):
    if s[i] not in check:
        res = "No"
        break
    if i != a and s[i] == "-":
        res = "No"
        break
print(res)

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

def is_int(s):
    try:
        int(s)
        return True
    except ValueError:
        return False

ans = 0
if is_int(s[0:a]) == True:
    if s[a] == "-":
        if is_int(s[a+1:]) == True:
            print("Yes")
            ans = 1
if ans == 0:
    print("No")