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:
A, B = map(int, (input().split()))
S = input().split('-')
ans = len(S) == 2
ans = False if not ans else A == len(S[0]) and B == len(S[1])
ans = False if not ans else A == len(str(int(S[0]))) and B == len(str(int(S[1])))
print('Yes' if ans else 'No')

Submission status: Wrong Answer

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

if s.count("-")==0:
    ans="No"
elif len(s[:s.index("-")])!=a:
    ans="No"
elif len(s[s.index("-")+1:])!=b:
    ans="No"
else:
    ans="Yes"
    
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

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

str_len = len(S)

for i in range(str_len):

    a = S[i]
    if i==A:
        break
    if str.isdecimal(a)==False:
        print("No")
        sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
l=[str(i) for i in range(10)]
n,m=map(int,input().split())
w=input()
for i in range(n):
  if w[i] in l:
    pass
  else:
    print("No")
    exit()
if w[i]!="-":
  print("No")
  exit()
for i in range(m):
  if w[i+1+n] in l:
    pass
  else:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if s[:a].isdecimal()==True and s[-b:]==True and s[a]=='-':
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
S = input()
if ('-' not in S[:A]) and (S[A] == '-') and ('_' not in S[A+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()
a = ['0','1','2','3','4','5','6','7','8','9']
for i in range(A+B):
    if (i == A and S[i] == '-') or (S[i] in a):
        continue
    else:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ls=[0,1,2,3,4,5,6,7,8,9]
a,b=[int(s) for s in input().split()]
S=input()
if S[a]=='-':
  for i in range(a):
    if not(S[i] in ls):
      print('No')
      break
  else:
    for j in range(b):
      if not(S[a+j+1] in ls):
        print('No')
        break
    else:
      print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

if S.count("-") == 0 or S.count("-") >= 2:
  print("No")
else:
  tmp = S.split("-")
  if len(tmp[0]) >= 1 and len(tmp[1]) >= 1:
  	print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

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

if S[A] != "-" or S[:A]in "-" or S[-B:] in "-":
    print('No')

else:
    print('Yes')

Submission status: Wrong Answer

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

if S[A] != '-' or S[:A]in '-' or S[-B:] in '-':
    print('No')

else:
    print('Yes')

Submission status: Wrong Answer

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

if S[A] != '-' or S[:A]in '-' or S[A+1:] in '-':
    print('No')

else:
    print('Yes')

Submission status: Wrong Answer

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

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

else:
    print('Yes')

Submission status: Wrong Answer

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

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

else:
    print('No')

Submission status: Wrong Answer

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

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

else:
    print('No')

Submission status: Wrong Answer

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

if S[A] == '-' and len(S) == A + B + 1 and S[:A] not in '-' and S[A+2:] not in '-':
    print('Yes')

else:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = input()
print('Yes') if "-" not in s[:a] and "-" not in s[-b:] or "-" in s 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:
def judge(S,A,B):
  a = list(S)
  front = a[0:A]
  back = a[A+1:A+B+1]
  lst = ["0","1","2","3","4","5","6","7","8","9"]
  for i in range(A):
    if front[i] not in lst:
      print("No1")
      return
            
  for j in range(B):
    if back[j] not in lst:
      print("No")
      return
            
  if a[A]!="-":
    print("No")
    return
  
  print("Yes")
  
A,B = map(int,input().split())
S = input()
judge(S,A,B)

Submission status: Wrong Answer

Solution code:
def judge(S,A,B):
  a = list(S)
  front = a[:A]
  back = a[A+1:]
  for i in range(A):
    if not type(front[i])==int:
      print("No")
      return
  for j in range(B):
    if not type(back[j])==int:
      print("No")
      return
  if not a[A]=="-":
    print("No")
    return
  print("Yes")
  
A,B = map(int,input().split())
S = input()
judge(S,A,B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = [int(x) for x in input().split()]
s = input()
if 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 len(s) != a + b+ 1:
	print ("No")
	exit()

if re.search('\d{3}',s[:a]) and s[a] == "-" and re.search('\d{4}',s[a+1:]):
	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()
if s[a] == "-" :
    try :
        if int(s[:a]) is int and int(s[a+1:]) is int :
            print("Yes")
    except :
        print("No")
else :
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re
a, b = [int(i) for i in input().split()]
print("Yes" if re.match(r"^\d{3}-\d{4}$", input()) else "No")

Submission status: Wrong Answer

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

flg_haihun="-" not in (S[0:A]+S[A+1:A+B+1])

print("Yes" if A+B+1==len(S) and flg_haihun else "No")

Submission status: Wrong Answer

Solution code:
# ABC 084: B – Postal Code
characters = '0123456789-'

a, b = [int(s) for s in input().split()]
s = input()

is_postal = 'Yes'

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

for c in s:
    if c not in characters:
        is_postal = 'No'
        break

print(is_postal)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
a,b=map(int,input().split())
S=list(input())
ans='Yes'
for i in range(a+b):
    if i==a:
        if S[i]!='-':
            ans='No'
            break
        else:
            continue
    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':
        continue
    else:
        ans='No'
        break
print(ans)
print(S)

Submission status: Wrong Answer

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

s = input()

flg = False
for idx,i in enumerate(s):
    if i == '-' and idx == a:
        flg = True
    else:
        flg = False
    
print('Yes' if flg else 'No')

Submission status: Wrong Answer

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

s = input()

flg = False
for idx,i in enumerate(s):
    if idx == a and i == '-':
        flg = True
        break
    
print('Yes' if flg else 'No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
S = input()
ans = True
for s in range(a+b+1):
    if s == a:
        if S[s] != "-":
            ans = False
    if s != a:
        if S[s] == "-":
            ans = False
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if len(s) != a + b + 1:
  print('No')
  exit()

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

Submission status: Wrong Answer

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

if len(s) != a + b + 1:
  print('No')
  exit()

for i in range(a):
  if 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()
if s[a] != '-':
  print('No')
  exit()
for i in range(a+1, b):
  if 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')

Submission status: Wrong Answer

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

if n != 8:
    print('No')
    exit()
for i in range(n):
    if i == 3:
        if S[i] == '-':
            continue
        else:
            break
    if not S[i].isdigit():
        break
else:
    print('Yes')
    exit()
print('No')

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
a_str = s[0:a]
b_str = s[a+1:a+b+1]

if len(a_str) == a and len(b_str) == b and s[a] == "-" and str.isdecimal(a_str) and str.isdecimal(a_str) 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()
a_str = s[0:a]
b_str = s[a+1:a+b+1]

if len(a_str) == a and len(b_str) == b and s[a] == "-" and str.isdecimal(a_str) and str.isdecimal(a_str):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A, B = tuple(int(num) for num in input().split())
S = input()

s_list = list(S)
  

for i, s in enumerate(s_list):
  if s_list[A] != '-':
    print('No')
    break
  if isinstance(s, int):
    continue
  else:
    print('No')
    break
else:
  print('Yes')

Submission status: Wrong Answer

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

if len(s) == a + b + 1 and s[a] == '-':
    ss = s.split('-', 1)
    if len(ss) == 2 and len(ss[0]) == a and len(ss[1]) == b:
        if ss[0].isdecimal() and s[1].isdecimal():
            print('Yes')
        else:
            print('No')
    else:
        print('No')
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] == '-':
    ss = s.split('-', 1)
    print(ss)
    if len(ss) == 2 and len(ss[0]) == a and len(ss[1]) == b:
        if ss[0].isdecimal() and s[1].isdecimal():
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

if a < 6 and b < 6 and len(s) == a + b + 1 and s[a] == '-':
    ss = s.split('-')
    print(ss)
    if len(ss) == 2 and len(ss[0]) == a and len(ss[1]) == b:
        if ss[0].isdecimal() and s[1].isdecimal():
            print('Yes')
        else:
            print('No')
    else:
        print('No')
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] == '-':
    ss = s.split('-')
    if len(ss) == 2 and len(ss[0]) == a and len(ss[1]) == b:
        if ss[0].isdecimal() and s[1].isdecimal():
            print('Yes')
        else:
            print('No')
    else:
        print('No')
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] == '-':
    ss = s.split('-')
    if len(ss) == 2 and len(ss[0]) == a and len(ss[1]) == b:
        if ss[0].isdecimal() and s[1].isdecimal():
            print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if s[a] == '-':
    ss = s.split('-')
    if len(ss) == 2 and len(ss[0]) == a and len(ss[1]) == b:
        if ss[0].isdecimal() and s[1].isdecimal():
            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] == '-':
    if s[:a].isdigit() and s[a+1:a+b+1].isdigit():
        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:].find('-'):
    if s[:a].isdigit() and s[a+1:a+b+1].isdigit():
        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.find('-'):
    if s[:a].isdigit() and s[a+1:a+b+1].isdigit():
        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:
    if s[:a].isdigit() and s[a+1:a+b+1].isdigit():
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
#2019/10/24
AB, S = open(0).readlines()
# print(AB, S)
A, B = map(int, AB.split())
# print(A, B)
print('Yes' if S[:A].isdecimal() and S[A]=='-' and S[A+1:].isdecimal() else 'No')

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
S=input()
f=True
if len(S)!=A+B+1:
    f=False
num=[chr(i) for i in range(ord('0'),ord('9')+1)]
for i,c in enumerate(S):
    if (i!=A and c not in S) or (i==A and c!='-'):
        f=False
print('Yes' if f else 'No')

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
if s[a:b] != "-":
  print("No")
  quit()
elif s[:a].isnumeric()==False or s[b:].isnumeric()==False:
  print("No")
  quit()
print("Yes")

Submission status: Wrong Answer

Solution code:
# B
a, b = map(int, input().split())
s = input()
n = len(s)
nums = list(range(10))
point = 0
flag = 'Yes'

if n < a+b+1:
    print('No')
    exit()

while (0<=point<=n-1):
    if point == a:
        if s[point] != '-':
            flag = 'No'
    else:
        if s[point] not in nums:
            flag = 'No'
    point += 1
print(flag)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
nums = list(range(10))

if s[a] != '-':
    print('No')
    exit()
else:
    split = s.split('-')
    mae, ushiro = split[0], split[1]
    for m in mae:
        if int(m) not in nums:
            print('No')
            exit()
    for u in ushiro:
        if int(u) not in nums:
            print('No')
            exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if s[a]!='-':
  ans = 'No'
else:
  s = s.replace('-', '')
  if len(s)==0:
    ans = 'No'
  if not all([i in '0123456789' for i in s]):
    ans = 'No'

    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if ( li[0:a-1].isnumeric() and li[a] == "-" and li[a+1:a+b-1].isnumeric() )== True:
    print("Yes")
else:
     print("No")

Submission status: Wrong Answer

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

for i in range(len(s)):
    if s[i] == '-' and i == a:
        print("Yes")
    elif s[i] == '-' and i  != a:
        print("No")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
l = list(range(10))
for i in range(len(s)):
    if i == 3 and s[i] != "-":
        print("No")
        exit()
    else:
        if s[i] not in l:
            print("No")
            exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
# ABC084B - Postal Code
def main():
    A, B = tuple(map(int, input().split()))
    S = input().rstrip()
    flg = S[A] == "-" and all(i in "0123456789" for i in S[:A] + S[A + 1 :])
    print("YES" if flg else "NO")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

count = 0
S_list = []
for s in S:
    S_list.append(s)
    if s == '-':
        pass
    else:
        count += 1

hy_count = S_list.count('-')

if count == len(S) - 1 and hy_count == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

count = 0
S_list = []
for s in S:
    S_list.append(s)
    if s == '-':
        break
    else:
        count += 1

u_count = S_list.count('-')

if count == A and u_count == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

count = 0
for s in S:
    if s == '-':
        break
    else:
        count += 1

if count == A:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    A, B = map(int,input().split())
    S = input()
    S_size = len(S)
    S1 = S[0:A]
    S2 = S[A+1:S_size-1]
    S_ = S[A]

    if S1.isdecimal() == True:
        judge1 = True
    else:
        judge1 = False

    if S2.isdecimal() == True:
        judge2 = True
    else:
        judge2 = False

    if S_ == '-':
        judge3 = True
    else:
        judge3 = False

    if judge1 == True and judge2 == True and judge3 == True:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_cnt = 0
b_cnt = 0
for i in s:
    if i == '-':
        break
    a_cnt += 1

for i in s[b:]:
    if i == '-':
        break
    b_cnt += 1

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

Submission status: Wrong Answer

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

a_cnt = 0
b_cnt = 0
for i in s:
    if i == '-':
        break
    a_cnt += 1

for i in s[b:]:
    if i == '-':
        break
    b_cnt += 1

if a == a_cnt and b == b_cnt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    a, b = map(int, input().rstrip('\n').split())
    s = input().rstrip('\n')
    ls = list("1234567890")
    for i in list(s[:a]):
        if i not in ls:
            print("No")
            exit()
    for i in list(s[b:]):
        if i not in ls:
            print("No")
            exit()
    if s[a] != "-":
        print("No")
        exit()
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    a, b = map(int, input().rstrip('\n').split())
    s = input().rstrip('\n')
    ls = list("1234567890")
    for i in list(s[:a]):
        if i not in ls:
            print("No")
            exit()
    for i in list(s[b:len(s)]):
        if i not in ls:
            print("No")
            exit()
    if s[a] != "-":
        print("No")
        exit()
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    a, b = map(int, input().rstrip('\n').split())
    s = input().rstrip('\n')
    ls = list("1234567890")
    for i in list(s[:a]):
        if i not in ls:
            print("No")
            exit()
    for i in list(s[b:]):
        if i not in ls:
            print("No")
            exit()
    if s[a] != "-":
        print("No")
        exit()
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    s = input().rstrip('\n')
    ls = list("1234567890")
    for i in list(s[:a]):
        if i not in ls:
            print("No")
            exit()
    for i in list(s[b:]):
        if i not in ls:
            print("No")
            exit()
    if s[a] == "-":
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    s = input().rstrip('\n')
    ls = list("1234567890")
    for i in list(s[:a]):
        if i not in ls:
            print("No")
            exit()
    for i in list(s[b:len(s)]):
        if i not in ls:
            print("No")
            exit()
    if s[a] == "-":
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def pC():
    A, B = map(int, input().split())
    S = list(input())
    for i in range(A):
        if S[i].isdecimal() == 0:
            print("No")
            return
    if S[A] != "-":
        print("No")
        return
    for i in range(A + 2, B):
        if S[i].isdecimal() == 0:
            print("No")
            return
    print("Yes")


pC()

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = list(input())
if s[a] == "-":
    s.remove(s[a])

ls = "0123456789"
c = 0
for i in s:
    if i in ls:
        c += 1
        
if c == a+b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def main(a,b,s):
  if len(s) != a+1+b :
    return 'No'
 
  for n,i in enumerate(s) :
    print(n,a)
    if n == a :
      
      if i != '-' :
        return 'No'
    else :
      try :
        int(i)
      except :
        return 'No'
  return 'Yes'
              
print(main(a,b,s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re
a,b =[int(i) for i in input().split()]
content = input()
 
pattern = '[0-9]{a}-[0-9]{b}'
 
search_result = re.search(pattern, content)
 
if not(search_result) :
  print("No")
elif search_result.group() == content:
  print('Yes')
else:
  print("No")

Submission status: Wrong Answer

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

pattern = '[0-9]{3}-[0-9]{4}'

search_result = re.search(pattern, content)

if not(search_result) :
  print("No")
elif search_result.group() == content:
  print('Yes')
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = list(input())
if 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()

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
s=str(input())
f=0
if s[a] !="-":
    f =0
else:
    c=s[:a]
    d=s[b:]
    if len(c)==a and len(d)==b:
        if "-" not in c:
            if "-" not in d:
                f=1
print("Yes" if f==1 else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
rule=[int(i) for i in input().split()]
nom=input()
if nom[rule[0]]=="-":
  if nom[rule[0]+1:].isdecimal() and nom[:rule[0]+1].isdecimal():
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
rule=[int(i) for i in input().split()]
nom=input()
if nom[rule[0]]=="-":
  if nom[rule[0]+1:].isdecimal():
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

Solution code:

def main():

    A,B = map(int,input().split())
    S = input()
    hihun = S[A]
    other = S[:A]+S[B:]

    print('Yes') if hihun == '-' and '-' not in other else print('No')









    
if __name__== "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
num = ['0','1','2','3','4','5','6','7','8','9']
A,B = map(int,input().split())
S = input()
if A+B+1 != len(S):
    print('No')
    sys.exit()
S = [c for c in S]
flag = 0
for i in range(A):
    for j in num:
        if S[i] == j:
            flag = 1
    if flag == 0:
        print('No')
        sys.exit()
if S[A] != '-':
    print('No')
    sys.exit()
for i in range(A+2,A+B+1):
    for j in num:
        if S[i] == j:
            flag = 1
    if flag == 0:
        print('No')
        sys.exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
import re
A,B = list(map(int,input().split(' ')))
S = input()
#print(A,B)
#m = re.match(r'(\d{\A}-\d{\B})',S)
m = re.match(r'^\d{1,5}-\d{1,5}$',S)

print(('Yes') if m and len(S)<=10 else ('No'))

Submission status: Wrong Answer

Solution code:
import re
A,B = list(map(int,input().split(' ')))
S = input()
#print(A,B)
#m = re.match(r'(\d{\A}-\d{\B})',S)
m = re.match(r'^\d{1,5}-\d{1,5}$',S)

print(('Yes') if m and 0<=len(S)<=10 else ('No'))

Submission status: Wrong Answer

Solution code:
import re
A,B = list(map(int,input().split(' ')))
S = input()
#print(A,B)
#m = re.match(r'(\d{\A}-\d{\B})',S)
m = re.match(r'^\d{1,5}-\d{1,5}$',S)

print(('Yes') if m and 0<=len(S)<=9 else ('No'))

Submission status: Wrong Answer

Solution code:
import re
A,B = list(map(int,input().split(' ')))
S = input()
#print(A,B)
#m = re.match(r'(\d{\A}-\d{\B})',S)
m = re.match(r'^\d{1,5}-\d{1,5}$',S)



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

Submission status: Wrong Answer

Solution code:
import re
A,B = list(map(int,input().split(' ')))
S = input()
#print(A,B)
#m = re.match(r'(\d{\A}-\d{\B})',S)
m = re.match(r'^\d{0,5}-\d{0,5}$',S)



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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
s=input().split('-')
print('YES' if len(s[0])==a and len(s[1])==b else 'NO')