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



Sample input:
3 4
269-6650


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
import sys
a,b = map(int,input().split())
s = list(input())
if s[a] != "-":
	print("No")
	sys.exit()
s.pop(s.index("-"))
for i in range(len(s)):
	if s[i].isdigit():
		if int(s[i]) >= 10 or int(s[i]) <= 0:
			print("No")
			sys.exit()
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
def resolve():
    A, B = map(int, input().split())
    S = input()
    C = "1234567890"
    for i in range(len(S)):
        if i == A:
            if S[i] == "-":
                continue
            else:
                print("No")
                exit()
            if S[i] in C:
                continue
            else:
                print("No")
                exit()
    print("Yes")
    exit()
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    A, B = map(int, input().split())
    S = input()
    C = "1234567890"
    if S[A] == "-":
        S.replace(S[A], "0")
        for i in range(len(S)):
            if S[i] in C:
                continue
            else:
                print("No")
                exit()
        print("Yes")
        exit()
    else:
        print("No")
resolve()

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = list(input())
n = len(s)
ans = "No"
for i in range(n):
  if s[i] == "-":
    if a == i:
      ans = "Yes"
if s.count("-") >= 1:
  ans = "No"
      
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if s.count('-') == 1:
    x,y = s.split('-')
    if x.isdigit and y.isdigit:
        print ("Yes")
        exit ()

print ("No")

Submission status: Wrong Answer

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

s =input()

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

for i in range(a):
    if s[i] in intlist:
        pass
    else:
        print("No")
        exit()

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

print("Yes")

Submission status: Wrong Answer

Solution code:
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, b):
    if s[i] == '-':
        flg = False
if flg:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
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 + 2, b):
    if s[i] == '-':
        flg = False
if flg:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
S = input()
try:
    int(S[:a])
    int(S[:-1-b])
except:
    print('No')
    exit()

if S[a] != '-':
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
import re
A,B=map(int,input().split());S=input()
check = re.compile('[1-9]+')
print('Yes' if check.search(S[:A]) and S[A]=='-' and check.search(S[B:]) else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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:-1]):
        print('Yes')
        return
    print('No')

resolve()

Submission status: Wrong Answer

Solution code:
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()

Submission status: Wrong Answer

Solution code:
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[b:]))
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")

Submission status: Wrong Answer

Solution code:
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[b:]))
count = 0
for i in range(len(ch1)):
    if ch1[i] not in ans:
        count +=1
for j in range(len(ch2)):
    if ch2[i] not in ans:
        count += 1
if count == 0 and s[a] == "-":
    print("Yes")
else:
    
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# 2020/06/03
# AtCoder Beginner Contest 084 - B

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

# Calc
is_a_dec = str.isdecimal(s[0:a])
is_b_dec = str.isdecimal(s[a+1:len(s)])

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

# Output
print(ans)

Submission status: Wrong Answer

Solution code:
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 '-' in s[a + 1:]:
    flag2 = True
  
if flag1 and flag2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#ABC084-B
a,b = map(int,input().split())
s = input()

mae = s[:a]
usiro = s[a+1:a+b+1]
#print(mae)
#print(usiro)
if mae.isdecimal() and usiro.isdecimal():
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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,b+1):
    if s[i]=="-":
        f = 1
if f==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

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

flag = True

if S[A] != "-":
	flag = False
elif len(S) != A+B+1:
	flag = False

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

if not S.isdigit():
	flag = False
else:
	flag = True

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
num = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
if s[:a] in num  and  s[a]=='-' and s[a+1:a+b+1] in num:
    print('Yes')
else :
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 'Yes'

length = len(s)

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

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

print(ans)

Submission status: Wrong Answer

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

ans = 'Yes'

length = len(s)

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

    if '0' <= s[x] and s[x] <= '9':
        continue
    else:
        ans = 'No'
        break

print(ans)

Submission status: Wrong Answer

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

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

ans = 'Yes'

if s[a] == '-':
    for x in range(a):
        if s[x] not in num:
            ans = 'No'
            break
    for x in range(a+1, b+1):
        if s[x] not in num:
            ans = 'No'
            break
else:
    ans = 'No'

print(ans)

Submission status: Wrong Answer

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

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

ans = 'Yes'

if s[a] == '-':
    for x in range(a):
        if s[x] not in num:
            ans = 'No'
            break
    for x in range(a+1, b):
        if s[x] not in num:
            ans = 'No'
            break
else:
    ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
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
print([c in num_list for c in list(s[:a]+s[a+1:]) ])
if s[a] == "-" and all([ c in num_list for c in list(s[:a]+s[a+1:]) ]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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 else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = input()
s_list = s
s_list = list(s_list)
flg = False
cnt = 0

for i in range(len(s_list)):
    if s_list[i] == '-':
        flg = True
    elif s_list[i].isdecimal():
        cnt += 1



if flg:
    if cnt == a + b:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = input()
s_list = s
s_list = list(s_list)
flg = False

for i in range(len(s_list)):
    if s_list[i] == '-':
        s_list.pop(i)
        flg = True
        break

if flg:
    if len(s_list) == a + b:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = input()
s_list = s
s_list = list(s_list)
flg = False

for i in range(len(s_list)):
    if i == '-':
        s_list.pop(i)
        flg = True
        break

if flg:
    if len(s_list) == a + b:
        print('Yes')
    else:
        print('No')
else:
    print('No')


'''


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

print(s)
print(s_list)
'''

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())

A, B = mi()
S = input()
number = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

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

for i in range(B):
    if i != A and S[i] not in number:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
s=input()
print(s)
if s[a]!="-":
    print("No")
    #print(1)
elif s.count("-")>1:
    print("No")
    #print(2)
else:
    s=s.replace("-","")
    #print(3)
    #print(s)
    if s.isdigit()==True:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
s_a = s[0:a]
s_b = s[(a+2):(a+2)+b]
minus = s[a]
if minus == "-" and s_a.isdecimal() and s_b.isdecimal():
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s =  input()
num = ["0","1","2","3","4","5","6","7","8","9"]
check = True
for i in range(a):
    if not s[i] in num:
        check = False
        break
if s[a+1] != "-":
    check = False

for j in range(b):
    if not s[j+a+1] in num:
        check = False
        break

if check == True:
    print("Yes")
if check == False:
    print("No")

Submission status: Wrong Answer

Solution code:
import collections

#文字列を一文字ずつ取得したいとき
def inputStrOnebyOne():
    s = list(input())
    return s

#整数を一つずつリストに入れる
def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

def main():
    a,b = input().split()
    s = input()
    if s.count("-") == 1:
        c,d = s.split("-")
        if a == str(len(c)) and b == str(len(d)):
            print("Yes")
    else:
        print("No")

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
s=str(input())
slist=list(s)
temp=slist.count("-")
if temp==1 and slist[a]=="-":
  s.replace("","-")
  if s.isdecimal()==True:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = input()
if s[a] == "-":
    s = s[0:a] + s[a:a+b+1]
    for i in s:
        if i == "-":
            print("No")
            exit()
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0

a,b = map(int,input().split())
s = input()
for x in range(len(s)):
    if s[x] == '-':
        neko = x
if (a == neko)and(b == len(s)-1-neko):
    py()
else:
    pn()

Submission status: Wrong Answer

Solution code:
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0

a,b = map(int,input().split())
s = input()
for x in range(len(s)):
    if s[x] == '-':
        break
if (a == x)and(b == len(s)-1-x):
    py()
else:
    pn()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if len(num) == 8 and num[:3].isdecimal() and num[3]== "-" and num[4:].isdecimal():
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
num = input()
if len(num) == 8 and num[:2].isdecimal() and num[3]== "-" and num[4:].isdecimal():
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
num = input()
if num[:2].isdecimal() and num[3]== "-" and num[4:].isdecimal():
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
a,b=map(int, input().split())
s=input()
l=len(s)
f=0
for i in s:
    if i=='-':
        f=f+1

if f==1:
    k=s.index('-')
    su=(k-0)
    f=(l-(k+1))
    if su==a and f==b and b==a+1:
        print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b=map(int, input().split())
s=input()
f=0
for i in s:
    if i=='-':
        f=f+1

if f==1 and b==a+1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if b==a+1:
    if '-' in x:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
S=input()
if str.isdigit(S[:A])==True and str.isdigit(S[-4:])==True and S[A]=="-":
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
S=input()
num=[str(k) for k in range(10)]

for i in range(A):
  if S[i] not in num:
    print('No')
    exit()
    
if S[A]!='-':
  print('No')
  exit()
  
for j in range(A+1,B):
  if S[j] not in num:
    print('No')
    exit()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
S=input()
num=[str(k) for k in range(1,10)]

for i in range(A):
  if S[i] not in num:
    print('No')
    exit()
    
if S[A]!='-':
  print('No')
  exit()
  
for j in range(A+1,B):
  if S[j] not in num:
    print('No')
    exit()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
stg = input()
res = "Yes"
for i in range(a):
  if not stg[i].isdigit():
    res = "No"
if not stg[a]=='-':
  res = "No"
for i in range(a+1,b+1):
  if not stg[i].isdigit():
    res = "No"
print(res)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
stg = input()
res = "Yes"
if len(stg)==a+b+1:
  if a>0:
    for i in range(a):
      if not stg[i].isdigit():
        res = "No"
  if not stg[a]=='-':
    res = "No"
  if b>0:
    for i in range(a+1,b+1):
      if not stg[i].isdigit():
        res = "No"
else:
  res = "No"
print(res)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
stg = input()
res = "Yes"
if len(stg)==a+b+1:
  for i in range(a):
    if not stg[i].isdigit():
      res = "No"
  if not stg[a]=='-':
    res = "No"
  for i in range(a+1,b+1):
    if not stg[i].isdigit():
      res = "No"
else:
  res = "No"
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
s=str(input())
c=0-b
if len(s) == a+b+1:
  if s[:a-1].isdecimal()==True and s[c:].isdecimal()==True and s[a]=="-":
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
s=str(input())
c=0-b
if s[:a-1].isdecimal()==True and s[c:].isdecimal()==True and s[a]=="-":
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = input()
sw = 0
for i in range(len(s)):
    if i == a and s[i] != '-':
        sw = 1
    elif i != a and s[i] == '-':
        sw = 1
    else:
        pass
if sw == 1:
    print('No')
else:
    print('Yse')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import re
A, B = map(int,input().split())
S = input()
pattern = '[0-9]*'
result = re.match(pattern, S)
if re.match(pattern, S[0:A:]) and S[A] == "-" and re.match(pattern, S[A+1:A+B+1:]) and len(S) == A+B+1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import re
A, B = map(int,input().split())
S = input()
pattern = r'[0-9]*'
result = re.match(pattern, S)
if re.match(pattern, S[0:A:]) and S[A] == "-" and re.match(pattern, S[A+1:A+B+1:]) and len(S) == A+B+1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
L = list(input())
c = L[a]
l = len(L)
ok = 0
if c == "-":
    ok = 1
    L.pop(a)
else:
    print("No")
    exit()
if len(L) == a+b:
    ok = 1
else:
    print("No")
    exit()
for i in range(len(L)):
    if str(L[i]).isnumeric() == True :
        print(i)
        ok =1
    else:
        ok = 0
        break

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
L = list(input())
c = L[a]
l = len(L)

if c == "-" and (a+b == l-1):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
## io
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
## dp
INIT_VAL = 0
MD2 = lambda d1,d2: [[INIT_VAL]*d2 for _ in range(d1)]
MD3 = lambda d1,d2,d3: [MD2(d2,d3) for _ in range(d1)]
## math
DIVC = lambda x,y: -(-x//y)
DIVF = lambda x,y: x//y

def main():
    a, b = MII()
    s = IS()
    d = {'1','2','3','4','5','6','7','8','9','0'}
    for i in range(a):
        if s[i] not in d:
            print('No')
            return None
    if s[a] != '-':
        print('No')
        return None
    for i in range(a+1,a+b+1):
        if s[i] not in d:
            print('No')
    print('Yes')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
ans = 'No'
s_a = s[:a]
s_h = s[a]
s_b = s[b:]
if s_a.isdecimal() and s_b.isdecimal() and s_h =='-':
    ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
ab = input().split('-')
if len(ab) == 2 and len(ab[0]) == a and len(ab[-1]) == b:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = list(input())
num = [str(i) for i in range(10)]
flag = True
if len(s)!=(a+b+1):
    flag = False
    
for i in range(a+b+1):
    if s[a]!='-':
        flag = False
        
    if 0<=i<a or a+1<=i<b:
        if not s[i] in num:
            flag = False
print('Yes' if flag==True else 'No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = list(input())
num = [str(i) for i in range(10)]
flag = True
for i in range(a+b+1):
    if s[a]!='-':
        flag = False
        
    if 0<=i<a or a+1<=i<b:
        if not s[i] in num:
            flag = False
            
    if i==0:
        if s[i]=='0':
            flag = False
print('Yes' if flag==True else 'No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = list(input())
num = [str(i) for i in range(10)]
flag = True
for i in range(a+b+1):
    if s[a]!='-':
        flag = False
        
    if 0<=i<a or a+1<=i<b:
        if not s[i] in num:
            flag = False
print('Yes' if flag==True else 'No')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = input()
for i in range(A+B+1):
    if S[A] == '-':
        if S[:A-1].isdecimal() == True and S[A+1:].isdecimal() == True:
            print('Yes')
            break
        else:
            print('No')
            break
else:
    print('No')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = input()
for i in range(A+B+1):
    if S[A] == '-':
        if S[:A-1].isdecimal() == True and S[A+1:].isdecimal() == True:
            print('Yes')
            break
else:
    print('No')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = list(input().split('-'))
try:
    if len(S[0]) == A and len(S2[1]) == B:
        print('Yes')
    else:
        print('No')
except:
    print('No')

Submission status: Wrong Answer

Solution code:
from collections import Counter
a,b = map(int,input().split())
s = input()

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

Submission status: Wrong Answer

Solution code:
nums = "1234567890"
a, b = map(int, input().split())
s = input()
ok_flg = True
for i in range(a):
    if s[i] not in nums:
        ok_flg = False
        break
print(s[a])
if s[a] != "-":
    ok_flg = False
for j in range(b):
    if s[a + 1 + j] not in nums:
        ok_flg = False
        break
if ok_flg == True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
inl=list(input())
print(inl)
try:
    for t in range(n):
        int(inl[t])
    for s in range(m):
        int(inl[n+1+s])
    if inl[n]=="-":
        print("Yes")
    else:
        print("No")
except Exception as e:
    print("No")

Submission status: Wrong Answer

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

if s[a] != "-" or s[0:a] in r'[^0-9]' or s[a+1::] in r'[^0-9]':
    print("No")
elif len(s[0:a]) != a or len(s[a+1::]) != b:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if s[a] == "-":
    if len(s[0:a]) == a and len(s[a+1::]) == b:
        if s[0:a] in r'[^0-9]' or s[a+1::] in r'[^0-9]':
            print("No")
        else:
            print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = S[:A]
c = S[A]
b = S[A:]

try:
    a = int(a)
    b = int(b)
    if c == '-':
        print('yes')
    else:
        print('no')
except:
    print('no')

Submission status: Wrong Answer

Solution code:

a,b = map(int,input().split())
s = list(input())
num = [0,1,2,3,4,5,6,7,8,9]
status = False

if s[a] != "-":
    print("No")
    exit()
else:
    for i in range(len(s)):
        if i == a:
            pass
        else:
            if s[i] not in num:
                print("No")
                exit()

print("Yes")

Submission status: Wrong Answer

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