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

ans = "No"
try:
  if(int(S[:A]) and S[A] == "-" and int(S[B:])):
    ans = "Yes"
except:
  pass
print(ans)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
S=input()
#print(A,B,S)
#print(S[:A],S[A+1:])
if(len(S[:A])==A and S[A]=='-' and len(S[A+1:])==B):
  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().split("-")
if len(s) == 2:
    print(["No","Yes"][len(s[0]+s[1])==a+b])
else:
    print("No")

Submission status: Wrong Answer

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

ans = 'Yes'
if S[a + 1] == '-':
    S = S.replace('-', '', 1)
    for i in S:
        if not i in '1234567890':
            ans = 'No'
else:
    ans = 'No'
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
S = list(input())
ans = True
if len(S) != (A+B+1):
    ans = False
elif S.count("-") != 1:
    ans = False
elif S.index("-") != A:
    ans = False
elif S != [i for i in S if i.isdecimal() or i == "-"]:
    ans = False
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
A,B = [int(n) for n in input().split()]
# N = int(input())
S = str(input())
if(S[A] != "-"):
    print("No")
    sys.exit()
S = S[:A] + S[A+1:]
L = len(S)
table = [n for n in range(10)]
for s in S:
    if not( s in table):
        print("No")
        sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
A,B = [int(n) for n in input().split()]
# N = int(input())
S = str(input())
if(S[A] != "-"):
    print("No")
    sys.exit()
L = len(S)
table = [n for n in range(10)]
for s in S:
    if not( s in table):
        print("No")
        sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
code = input()
first = code[:a]
second = code[b:]
if (('-' not in first) & ('-' not in second) & ('-' == code[a])):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
code = input()
first = code[:a]
second = code[b:]
if (('-' not in first) & ('-' not in second) & ('-' in code[a])):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=input().split();s=input()
if s.count('-')<1 or s.count('-')>1:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
from sys import stdin
a = [int(i) for i in input().split()] 
s = stdin.readline().rstrip()
if s.find('-') != a[0]:
 ans = 'No'
else:
 ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import re
A, B = map(int, input().split())
S = input()

if S[A] != "-":
    print("No")
else:
    if S[0: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=input()
#print(a, b, s)

flag=1

if s.count('-') < 1 or  s.count('-') > 1:
  flag=0
else:
  s1, s2=[int(i) for i in s.split('-')]
#print(s1,s2)
  if s1>=10**a or s2 < 10**(b-1):
    flag=0

print('Yes' if flag==1 else 'No')

Submission status: Wrong Answer

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

flag=1

if s.count('-') < 1 or  s.count('-') > 1:
  flag=0
else:
  s1, s2=[int(i) for i in s.split('-')]
#print(s1,s2)
  if s1 < 10**(a-1) or s1>=10**a or s2 < 10**(b-1) or s1>=10**b:
    flag=0

print('Yes' if flag==1 else 'No')

Submission status: Wrong Answer

Solution code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
e = 0
for i in range(d):
    if c[i] =="-" and i != a:
        e = e + 1
if a+b+1 == d and c[a] =="-" and e > 0:
    
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
e = 0
for i in range(d):
    if c[i] !="-" and i != a:
        e = e + 1
if a+b+1 == d and c[a] =="-" and e > 0:
    
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
e = 0
for i in range(d):
    if c[i] !="-" and i != a:
        e += 1
if a+b+1 == d and c[a] =="-" and e > 0:
    
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
e = 0
for i in c:
    if i !="-" and i != a:
        e += 1
if a+b+1 == d and c[a] =="-" and e > 0:
    
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
e = 0
for i in c:
    if i !="-" and i != a+1:
        e += 1
if a+b+1 == d and c[a] =="-" and e > 0:
    
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
e = 0
for i in c:
    if i !="-" and i !=i:
        e += 1
if a+b+1 == d and c[a] =="-" and e==d:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
if a+b+1 == d and c[a] =="-":
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(A):
    if S[i] not in NUM:
        print("No")
        quit()

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

for i in range(A + 1, B):
    if S[i] not in NUM:
        print("No")
        quit()
print("Yes")

Submission status: Wrong Answer

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

for i in range(A):
    if(S[i]!=(0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9)):
        print("No")
        quit()
for i in range(A+1,A+B+1):
    if(S[i]!=(0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9)):
        print("No")
        quit()
        

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()
flag=s.rfind("-")==s.find("-")

if flag:
    if a==s.find("-"):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
# Postal Code
a, b = map(int, input().split())
s = input()
for i, char in enumerate(s):
    if i == a:
        if char != '-':
            exit(print('No'))
    else:
        if '0' <= char <= '9':
            pass
        else:
            exit(print('No'))

Submission status: Wrong Answer

Solution code:
# Postal Code
a, b = map(int, input().split())
s = input()
if s[a] == '-':
    try:
        int(s[:a:])
        int(s[a+1::])
        exit(print('Yes'))
    except:
        pass
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
S = str(input())
c = A+B+1

if len(S)==c:
    if S.find("-")>0:
        if str.isdecimal(S[0:S.find("-")]):
            if str.isdecimal(S[S.find("-")+1:len(S)]):
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
S = str(input())
c = A+B+1
if len(S)==c:
    if S.find("-")>0:
        if str.isdecimal(S[0:S.find("-")]):
            if str.isdecimal(S[S.find("-")+1:len(S)]):
                print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

def abc084_b():
    import re
    a, b = map(int, input().split())
    s = input()

    return "Yes" if re.match("[0-9]{a}-[0-9]{b}", s) else "No"


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

Submission status: Wrong Answer

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

    return "Yes" if re.match("[0-9].{a}-[0-9].{b}", s) else "No"


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

Submission status: Wrong Answer

Solution code:
def abc084_b():
    import re
    a, b = map(int, input().split())
    s = input()
    
    return "Yes" if re.match("[0-9].*-[0-9].*", s) else "No"


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

Submission status: Wrong Answer

Solution code:
def abc084_b():
    import re
    return "Yes" if re.match("[0-9].*-[0-9].*", input()) else "No"


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

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
#! = map(int, input().split())
#! = [int(input()) for i in range()]

#A
"""
n,l=map(int, input().split())
s=[list(input()) for i in range(n)]
s.sort()
for i in s:
    for j in i:
        print(j,end="")
print()
"""

#B
a,b = map(int,input().split())
s = list(input())
k = s[:a]
asfpod = list("11234567890")
d = s[a+1:]
for i in k:
    if i not in asfpod:
        print("No")
        quit()
for i in d:
    if i not in asfpod:
        print("No")
        quit()
print("Yes")
#C

#D

#E

#F
"""
n = int(input())
a = list(map(int, input().split()))
l = 0
r = 0
if n == 1:
    print(1)
    quit()
ans = 0
flag = [False for i in range(200000)]
flag[a[0]] = True
while r < n-1:
    r += 1
    while flag[a[r]]:
        flag[a[l]] = False
        l += 1
    ans = max(ans, r-l+1)
    flag[a[r]] = True
print(ans)
"""

#G
"""
r,c,d = map(int, input().split())
stage = [list(map(int, input().split())) for i in range(r)]
lis = []
for i in range(r):
    for j in range(c):
        lis.append([stage[i][j],i,j])
lis.sort(key = lambda x:-x[0])

for l,y,x in lis:
    if y+x <= d and (y+x-d)%2 == 0:
        print(stage[y][x])
        quit()
"""
#H

#I
"""
mod = 1000000007

def pow(a,b,c):
    n = 1
    m = a
    v = b
    while v > 0:
        if v%2 == 1:
            n *= m%c
            n %= c
        m *= m
        m%= c
        v //= 2
    return n%c

n = int(input())
a = list(map(int, input().split()))
l = 0
r = 0
ans = 0
flag = False
while r < n-1:
    while a[r] != -1:
        r += 1
        if r == n-1:
            break
    l = r-1
    while a[r] == -1:
        flag = True
        r += 1
    if a[r] != a[l]:
        su = 1
        s = a[r]-a[l]+1
        for i in range(1, r-l):
            su *= (s+i-1)
            su %= mod
            su *= pow(i, mod-2, mod)
            su %= mod
        ans += su
        ans %= mod
if ans == 0 and flag:
    ans = 1
print(ans)
"""
#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = input()
i = S.find("-")
if i == -1:
    print("No")
    exit()

s = list(S)
if not(i == A):
    print("No")
    exit()
if not(len(s)-(i+1) == B):
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = 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 = list(input())
if len(S) == A+B+1 and S[A] == '-' and S.count('#') == 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] == "-" and s[-1] != "-" else "No")

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
s = str(input())
list_pre = []
list_post = []
count = 0
while count < a + b + 1:
    if s[count] == "-":
        count += 1
        break
    list_pre.append(s[count])
    count += 1
while count < a + b + 1:
    list_post.append(s[count])
    count += 1
if len(list_pre) == a and len(list_post) == b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
s = input()
if '-' in s and s.index('-')==A:
  num = [i for i in range(10)]
  for n in range(A):
    if s[n] in num ==False:
      break
    else:
      pass
  for m in range(A+1,A+1+B):
    if s[m] in num ==False:
      break
    else:
      print('Yes')
      exit()
else:
  pass
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split());s=input();print(['No','Yes'][s[a]=='-'and s.count('-')<0])

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split());s=input();print(['No','Yes'][s[a]=='-'and s.count('-')>2])

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split());s=input();print(['No','Yes'][s[a]=='-'and s.count('-')>0])

Submission status: Wrong Answer

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

if S[A] != "-" or not S[:A].isdecimal() or not S[B:].isdecimal():
    print("No")
    exit()

if len(S[:A]) != A or len(S[B:]) != B:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

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

if S[A] != "-" or not S[:A].isdecimal() or not S[B:].isdecimal():
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

a,b = (int(_) for _ in input().split())
s = str(input())

if '-' not in s:
    print("No")
    sys.exit(0)

s1,s2 = s.split('-',1)
if len(s1) > 0 and len(s2) > 0 and a == len(s1) and b == len(s2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

a,b = (int(_) for _ in input().split())
s = str(input())

if '-' not in s:
    print("No")
    sys.exit(0)

s1,s2 = s.split('-',1)
if a == len(s1) and b == len(s2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

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

def solve():
	if A+B+1 != len(S):
		return False

	for i in range(A+B+1):
		if i < A:
			if S[i] == '-':
				return False

		if A<= i < B:
			if S[i] != '-':
				return False

		if B <= i:
			if S[i] == '-':
				return False

	return True

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

Submission status: Wrong Answer

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

if s.count('-') != 1:
    print("No")

elif s[a] == "-":
    #print(s.replace('-', ''))
    if s.replace('-', '').isdecimal():
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

if s[a] == "-":
    #print(s.replace('-', ''))
    if s.replace('-', '').isdecimal():
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B=list(map(int, input().split()))
S=list(input())
ct=-1
for i in S:
    ct+=1
    if i=='-':
        break
print("Yes" if ct==A and len(S)==A+B+1 else "No")

Submission status: Wrong Answer

Solution code:
A,B=list(map(int, input().split()))
S=list(input())
print(S)
ct=-1
for i in S:
    ct+=1
    if i=='-':
        break
print("Yes" if ct==A and len(S)==A+B+1 else "No")

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
s=input()
if '-' not in s or s.count('-')>1 or s[0]==1 or s[-1]:
    print('No')
    exit()

p=s.split('-')
print('No' if s[a]!='-' or len(p[0]!=a or len(p[1])!=b) else 'Yes')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

c = 0
for i in range(0,a):
    if s[i] == '0' or'1' or '2' or '3' or'4' or'5'or '6' or '7' or '8' or '9':
        c = c+1
if s[a] == '-':
    c = c + 1
for i in range(0,b):
     if s[i+a+1] ==  '0' or'1' or '2' or '3' or'4' or'5'or '6' or '7' or '8' or '9':
        c = c+1
if c == 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 not '0' <= S[i] <= '9':
    flag = False
if S[A] != '-':
  flag = False
for i in range(B):
  if not '0' <= S[A+i] <= '9':
    flag = False
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = input()
L = len(str(S))
if A >= 1 and B <= 5:
    if L == A + B + 1:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

if post[:A].isdigit() ==True and post[A]=='-' and post[B:].isdigit() ==True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(a,b,c):
    if a+b+1==len(c):
        if c.count('-')==1:
            return 'Yes'
        if c.count('-')!=1:
            return 'No'
    else:
        return 'No'

Submission status: Wrong Answer

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c):
    a=0
    b=0
    if c.count('-')==1:
        return 'Yes'
    if c.count('-')!=1:
        return 'No'
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(n, i, s):
    c = 0
    for i in s:
        if i=='-':
            c+=1
    if  s[n]=='-' and c==1:
        return 'yes'
    else:
        return 'No'

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c):
    if len(c) == a+b+1:
        if  c.count("-")!=1:
            return "No"
        elif c[a]==("-"):
            return "Yes"
        else:
            return "No2"
    else:
        return "No4"
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if '-' in S:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

try:
    if '-' not in s: raise ValueError
    sa, sb = map(str, s.split('-'))
#     print(sa, sb)
    if len(sa)==a and len(sb)==b:
        print('Yes')
except ValueError:
    print('No')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
s = input()
for i in range(len(s)):
    if i<A and s[i]=='-':
        print("No")
        exit()
    elif i==A and s[i]!='-':
        print("No")
        exit()
    elif A<i<B and s[i]=='-':
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
S = input()
def crazy(a,b,S):
    num = "0123456789"
    if S[a] != "-":
        return False
    for i in S[:a]:
        if i not in num:
            return False
    return True

if crazy(a,b,S):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if S[0:A-1].isdigit() and S[A] == '-' and S[A+1:].isdigit() 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 = input()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

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

if not S[0:A-1].isdecimal():
    print('No')
    sys.exit()

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

if not S[A+1:].isdecimal():
    print('No')
    sys.exit()

else:
    print('Yes')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if list(S)[A] != '-':
    print('No')
else:
    if S[0:3].isdecimal() and S[5:].isdecimal():
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

'''
if(S.find("-")==A):
    print("Yes")
else:
    print("No")
'''

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

Submission status: Wrong Answer

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

if(S.find("-")==A):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
S = list(input())
if A+B+1-len(S) != 0:
    print("No")
    exit()
for i in range(len(S)):
    if (ord(S[i]) < ord("0") or ord(S[i]) > ord("9")) ^ i == A:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
S = list(input())
for i in range(len(S)):
    if (ord(S[i]) < ord("0") or ord(S[i]) > ord("9")) ^ i == A:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

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

if '-' in S[:A]:
    print('No')
    sys.exit()

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

if '-' in S[4:]:
    print('No')
    sys.exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
x = list(map(str, input().split('-', 1)))
if(len(x[0]) == a and len(x[1]) == b):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A, B =map(int, input().split())
S=input()
count=0
for i in range (10**(A-1),10**A):
    if S[0:A]==str(i):
        count+=1
if S[A]=='-':
    count+=1
for j in range (10**(B-1),10**B):
    if S[A+1:A+B]==str(j):
        count+=1

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

Submission status: Wrong Answer

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

count=0
for i in range (10**A):
    if S[0:A]==str(i):
        count+=1
if S[A]=='-':
    count+=1
for j in range (10**B):
    if S[A+1:A+B]==str(j):
        count+=1

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

Submission status: Wrong Answer

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

if len(post) == 2:
    if(len(post[0])==a and len(post[1])==b):
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = list(input())
print(s)
print(len(s), a+b+1)
flag = True
if len(s) == a+b+1:
    if s[a] == "-":
        s.pop(a)
        for i in s:
            if i == "-":
                flag = False
    else:
        flag = False
else:
    flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#coding: utf-8
import re
A,B = map(int,input().split())
S = input()
find_underscore = re.findall("\-",S[A])
find_num_a = re.findall("[0-9]",S[:A-1])
find_num_b = re.findall("[0-9]",S[A+1:])
if find_underscore and find_num_a and find_num_b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#coding: utf-8
import re
A,B = map(int,input().split())
S = input()
find_underscore = re.findall("-",S[A])
find_num_a = re.findall("[0-9]",S[:A-1])
find_num_b = re.findall("[0-9]",S[A+1:])
if find_underscore and find_num_a and find_num_b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
S = input()
f = False
for i in range(len(S)):
    if i < A:
        if S[i].isdigit() and not S[i] == " ":
            continue
        else:
            f = True
    if i == A:
        if S[i] == "-" and not S[i] == " ":
            continue
        else:
            f = True
    if A < i < B:
        if S[i].isdigit() and not S[i] == " ":
            continue
        else:
            f = True
    if f:
        print("No")
        break
if not f:
    print("Yes")