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()
f = False
for i in range(len(S)):
    if i < A:
        if S[i].isdigit():
            continue
        else:
            f = True
    if i == A:
        if S[i] == "-":
            continue
        else:
            f = True
    if A < i < B:
        if S[i].isdigit():
            continue
        else:
            f = True
    if f:
        print("No")
        break
if not f:
    print("Yes")

Submission status: Wrong Answer

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

sl = s.split('-')
if len(sl) != 2:
    print('No')
elif ( sl[0].isdecimal() and len(sl[0]) ) and ( sl[1].isdecimal() and len(sl[1]) ):
   print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

sl = s.split('-')
if len(sl) != 2:
    print('No')
elif ( sl[0].isdigit() and len(sl[0]) ) and ( sl[1].isdigit() and len(sl[1]) ):
   print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

sl = s.split('-')
try:
    if ( sl[0].isdigit() and len(sl[0]) ) and ( sl[1].isdigit() and len(sl[1]) ):
       print('Yes')
    else:
        print('No')
# no hyphon in the given strings
except IndexError:
    print('No')

Submission status: Wrong Answer

Solution code:
import re
A, B = list(map(int, input().split()))
S = input()
if S[A] != '-':
    print("No")
    exit()
S = S[:A] + S[A+1:]
if re.compile(r'\d').match(S):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
chars = list(input())
for i in range(A):
    if not chars[i].isdigit():
        print("No")
        exit()
if chars[A] != '-':
    print("No")
    exit()

for i in range(A+1, B):
    if not chars[i].isdigit():
        print("No")
        exit()
if A+B+1 != len(chars):
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
chars = list(input())
for i in range(A):
    if not chars[i].isdigit():
        print("No")
        exit()
if chars[A] != '-':
    print("No")
    exit()

for i in range(A+1, B):
    if not chars[i].isdigit():
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
chars = list(input())
for i in range(A):
    if not chars[i].isdigit():
        print("No")
        exit()
if chars[A+1] != '-':
    print("No")
    exit()

for i in range(A+1, B):
    if not chars[i].isdigit():
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
chars = list(input())
for i in range(A):
    if not chars[i].isdigit():
        print("Noa")
        exit()
if chars[A] != '-':
    print("No")
    exit()

for i in range(B):
    if not chars[i].isdigit():
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# --*-- encoding:utf-8 --*--

ab = list(map(int, input().split(" ")))
code = input()

notflag = False
for i in range(ab[0]):
	if( code[i] not in "0123456789" ):
		notflag = True

if( code[ab[0]] != "-" ):
	notflag = True

for i in range(ab[0]+1, ab[1]):
	if( code[i] not in "0123456789" ):
		notflag = True

if(notflag == False):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
# --*-- encoding:utf-8 --*--

ab = list(map(int, input().split(" ")))
code = input()

notflag = False
for i in range(ab[0]):
	if( code[i] not in "123456789" ):
		notflag = True

if( code[ab[0]] != "-" ):
	notflag = True

for i in range(ab[0]+1, ab[1]):
	if( code[i] not in "123456789" ):
		notflag = True

if(notflag == False):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
x=0
if s[a+1-1]=='-':
    for i in set(s)-{'-'}:
        if i not in ('0','1','2','3','4','5','6','7','8','9'):
            x=0
            break
        else:
            x=1
else:
    x=0
if x==0:
    print('No')
elif x==1:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

res = 'Yes'
if S[A] != '-' or len(S) != A+B+1:
    res = 'No'
#     print('0')
else:
    for i in range(A):
        if not S[i] in '1234567899':
#             print('1')
            res = 'No'
            break
    for i in range(B):
        if not S[A+i+1] in '1234567890':
#             print('2')
            res = 'No'
            break
print(res)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

a,b = na()
s = ns()
flag = 0
if s[a] == "-":
    s = s.replace("-","")
    for i in s:
        for j in range(10):
            if i == str(j):
                flag = 1
                break
            flag = 0
        if flag == 0:
            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

flag=True
if S[A]!='-':
    flag=False
a=S[:A]
b=S[A+1:]
print(a)
print(b)
if not(a.isdigit() and b.isdigit()):
    flag=False
if flag:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem B

if __name__ == '__main__':
    import re

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

    text = r'(\d{{0}})\-(\d{{1}})'.format(A, B)
    pattern = re.compile(text)
    result = pattern.search(S)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b = list(map(int, input().split()))
s = list(input())
while "-" in s:
    s.remove("-")

if len(s) == (a + b):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

if not S[:A].isdigit():
    print("No")
    exit()

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

if not S[B:].isdigit():
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

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

if not S[:A].isdigit():
    print("No")
    exit()

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

if not S[B:].isdigit():
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = str(input())
s = list(S)
No = 0
if A + B + 1 != len(S):
    print('No')
    No = 1
if No == 0:
    for i in range(A):
        if s[i] == '-':
            print('No')
            No = 1
if No == 0:
    for i in range(B):
        if s[A + i + 1] == '-':
            print('No')
            No = 1
if No == 0:
    if s[A] == '-': print('Yes')
    else: print('No')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = str(input())
s = list(S)
No = 0
for i in range(A):
    if s[i] == '-':
        print('No')
        No = 1
if No == 0:
    for i in range(B):
        if s[A + i + 1] == '-':
            print('No')
            No = 1
if No == 0:
    if A + B + 1 == len(S) and s[A] == '-': print('Yes')
    else: print('No')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = str(input())
s = list(S)
No = 0
for i in range(A):
    if s[i] == '-':
        print('No')
        No = 1
if No == 0:
    for i in range(B):
        if s[A + i] == '-':
            print('No')
            No = 1
if No == 0:
    if A + B + 1 == len(S) and s[A] == '-': 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 = 'No'
else:
    for i in range(a+b+1):
        if i == a and s[i] != '-':
            ans = 'No'
            break
        if not s[i].isdigit() and i != a:
            ans ='No'
            break
print (ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = list(input())
ans = True
for i in range(a+b+1):
    if i == a and s[i] != '-':
        ans = 'No'
    if not s[i].isdigit() and i != a:
        ans ='No'
        break
    if s[i].isdigit() and i != a:
        if 0>int(s[i]) or int(s[i]) > 9:
            ans ='No'
            
print (ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
S = list(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] == '-':
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
a,b = map(int,raw_input().split())
valid = True
s = raw_input()
for ind in range(len(s)):
        if ind == a:
            if s[ind] != "-":
                valid = False
        else:
            if s[ind].isalpha():
                valid = False        
if valid: print "Yes"
else: print "No"

Submission status: Wrong Answer

Solution code:
a,b = map(int,raw_input().split())
valid = False
s = raw_input()
if s[a+1] == "-":
    for let in s:
        if let.isalpha():
            valid = True
if valid: print "Yes"
else: print "No"

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def solve(a,b,s):
    v = 0
    for v in range(a):
        if s[v].isdigit() != True:
            return 'NO'
    
    if s[v+1] != '-':
        return 'No'

    for p in range(v+2,a+b+1):
        if s[p].isdigit() != True:
            return 'No'
    
    return 'Yes'

print(solve(a,b,s))

Submission status: Wrong Answer

Solution code:
A, B = input().strip().split(' ')
A, B = [int(A),int(B)]
S = input()

print(S[:A]+'-'+S[A:])

Submission status: Wrong Answer

Solution code:
import re

def validate(a, b, s):
    pattern = "\\d{%d}-\\d{%d}"%(a, b)
    print(pattern)
    m = re.match(pattern, s)
    return m is not None



if __name__ == "__main__":
    a, b = map(int, input().split())
    s = input()
    if validate(a, b, s):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a,b = list(map(int,input().split()))
s = input()

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a,b = list(map(int,input().split()))
s = input()


if s.find("-") != -1:
    s = s.split("-")
    print(a,b,s[0],s[1])

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

else:
    print("No")

Submission status: Wrong Answer

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

for i in range(a):
    if yubin[i] == '-':
        answer = 'No'

if yubin[a] != '-':
    answer = 'No'

for i in range(a + 1, b):
    if yubin[i] == '-':
        answer = 'No'

if answer == 'No':
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    
    A, B = [int(x) for x in input().split(' ')]
    S = input()

    S = S.split('-')
    if len(S) < 2:
        print('No')
        exit()

    a = S[0]
    b = S[1]

    if len(a) == A:
        if len(b) == B:
            print('YES')
            exit()

    print('No')

Submission status: Wrong Answer

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

s = int(A)+int(B)+1
ans = ""

if len(S) > s or len(S) < s or len(S[int(A)+1:s]):
    ans = "No"

elif S[int(A)] == "-":
    S[int(A)] == 0
    for i in range(int(A)+int(B)+1):
        if S[i].isdigit():
            ans = "Yes"
        else:
            ans = "No"

else:
    ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:

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

ans = ""

if len(S) > int(A)+int(B)+1 or len(S) < int(A)+int(B)+1 :
    ans = "No"

elif S[int(A)] == "-":
    S[int(A)] == 0
    for i in range(int(A)+int(B)+1):
        if S[i].isdigit():
            ans = "Yes"
        else:
            ans = "No"

else:
    ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
import re
match = re.match('^[0-9]{3}-[0-9]{4}$', input())
if match:
	print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

    for i in s[0:a]:
        if '0' > i or i > '9':
            print("NO")
            return
    if s[a] != '-':
        print("NO")
        return
    for i in s[a+1:a+b+1]:
        if '0' > i or i > '9':
            print("NO")
            return
    print("YES")
    return

solve()

Submission status: Wrong Answer

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

sliceA = S[0:A]
sliceB = S[A+1:A+B+1]

if sliceA.isdigit() and sliceB.isdigit() and S.find("-") == A and len(sliceA) == A and len(sliceB) == B:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
l = input().split()
s = input()
c = list(s)
b = True
for i in range(int(l[0])):
    if not (c[i] >= '0' and c[i] <= '9'):
        b = b and False
if not (c[int(l[0])] is '-'):
    b = b and False
for i in range(int(l[1])):
    if not (c[int(l[0]) + 1 + i] >= '0' and c[int(l[0]) + 1 + i] <= '9'):
        b = b and False
if b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
print("Yes")

Submission status: Wrong Answer

Solution code:
print("No")

Submission status: Wrong Answer

Solution code:
strnum = [str(i) for i in range(10)]

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

S = input()

judge = True if len(S) == a + b + 1 else False
for i in range(a + b + 1):
	if judge:
		break
	if i != a:
		if S[i] in strnum:
			continue
		else:
			judge = False
	else:
		if S[i] == "-":
			continue
		else:
			judge = False
if judge:
	print("Yes")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
strnum = [str(i) for i in range(10)]

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

S = input()

judge = True
for i in range(a + b + 1):
	if i != a:
		if S[i] in strnum:
			continue
		else:
			judge = False
	else:
		if S[i] == "-":
			continue
		else:
			judge = False
if judge:
	print("Yes")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
strnum = [str(i) for i in range(10)]

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

S = input()

judge = True
for i in range(a + b + 1):
	if i != a:
		if i in strnum:
			continue
		else:
			judge = False
	else:
		if S[i] == "-":
			continue
		else:
			judge = False
if judge:
	print("Yes")
else:
	print("NO")

Submission status: Wrong Answer

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

# 先頭A文字が数字か？,A+1文字目がハイフンか？,残りB文字が数字か？
cond = [True,True,True]
for i in range(A):
  if S[i] not in '0123456789':
    cond[0]=False
if S[A]!='-':
  cond[1]=False
for i in range(A+1,B):
  if S[i] not in '0123456789':
    cond[2]=False

if all(cond):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import re
z=input()[:-1].split(" ")
s=input()
print("Yes") if re.match("[0-9]{"+z[0]+"}-[0-9]{"+z[1]+"}",s) 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] == "-":
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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


if (len(S) == (A+B+1)) and (S[A] == '-') and (S.count('-') == 1) and len(re.findall('[0-9]', S)) == (A+B):
    print("Yes")
else:
    print("No")

print(len(re.findall('[0-9]', S)))

Submission status: Wrong Answer

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


if (len(S) == (A+B+1)) and (S[A] == '-') and (S.count('-') == 1) and len(re.findall('[0-9]', S)) == (A+B):
    print("yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

(A,B),S = map(int,input().split()),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:
import sys

(A,B),S = map(int,input().split()),input()
print("A: ", A)
print("B: ", B)
print("S: ", S)
print("length: ", len(S))

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

Submission status: Wrong Answer

Solution code:
line=input().split(' ')
s=input()
a=int(line[0])
b=int(line[1])
c=['0','1','2','3','4','5','6','7','8','9']
m=0
for n in range(a+1+b):
  if n==a:
    if s[n]!='-':
      print('No')
      break
  elif s[n] in c:
    m+=1

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

Submission status: Wrong Answer

Solution code:
l = map(int, raw_input().split())
k = raw_input()
listed = list(k)
if (len(k) == (l[0] + l[1] + 1)) and (listed[l[0]] == "-"):
    if (type(listed[l[0]+1]) == int) and (type(listed[l[0]-1]) == int):
        print "Yes"
        exit()
    print "No"
else:
    print "No"

Submission status: Wrong Answer

Solution code:
l = map(int, raw_input().split())
k = raw_input()
listed = list(k)
if (len(k) == (2 + l[0] + l[1])) and (listed[l[0]] == "-") and ((listed[l[0]+1] in range(10)) and ((listed[l[0]-1]) in range(10))):
    print "Yes"
else:
    print "No"

Submission status: Wrong Answer

Solution code:
import re

a, b = raw_input().split(" ")
s = raw_input()

pat = '^\d{' + a + '}-\d{' + b + '}$'
print "YES" if (re.match(pat, s) is not None) else "NO"

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

if S[A] != '-':
    print "No"

else:
    Flag = 0
    for i in range(A):
        if (S[i] < '0' or S[i] > '9') == False:
            Flag = 1
            #print "hello1"
    for i in range(A+1,len(S)):
        if (S[i] < '0' or S[i] > '9') == False:
            Flag = 1

    if Flag == 1:
        print "No"
    else:
        print "Yes"

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

if S[A] != '-':
    print "No"

else:
    Flag = 0
    for i in range(A):
        if (S[i] >= '0' and S[i] <= '9') == False:
            Flag = 1
            print "hello1"
    for i in range(A+1,len(S)):
        if (S[i] >= '0' and S[i] <= '9') == False:
            Flag = 1

    if Flag == 1:
        print "No"
    else:
        print "Yes"

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

if S[A] != '-':
    print "No"

else:
    Flag = 0
    for i in range(A):
        if S[i] <= '0' or S[i] >= '9':
            Flag = 1
    for i in range(A+1,len(S)):
        if S[i] <= '0' or S[i] >= '9':
            Flag = 1

    if Flag == 1:
        print "No"
    else:
        print "Yes"

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

if S[A] != '-':
    print "No"

else:
    Flag = 0
    for i in range(A):
        if S[i] >= '0' and S[i] <= '9':
            Flag = 1
    for i in range(A+1,len(S)):
        if S[i] >= '0' and S[i] <= '9':
            Flag = 1

    if Flag == 1:
        print "No"
    else:
        print "Yes"

Submission status: Wrong Answer

Solution code:
A,B=(int(i) for i in input().split())
S=input()
i=0
r="No"
#rint(S[i].isdigit())
while i<A and S[i].isdigit()==True:
    i+=1
#rint(i)
if i==A and S[i]=="-":
    i+=1
    while i<A+B and S[i].isdigit()==True:
        i+=1
#rint(i)
if i==A+B+1:
    r="Yes"
print(r)

Submission status: Wrong Answer

Solution code:
l = input().split()
a=input()

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

Submission status: Wrong Answer

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

flag = 0

for i in range(len(S)):
    if S[i] == '-':
        if i == A:
            flag = 1
        else:
            flag = 0

if flag == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
l = input().split()
a=input()

b=a.split("-")
if len(b[0]) == l[0] and len(b[1])==l[1]:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a,b = map(int, raw_input().split())
s = raw_input()
s_len = len(s)
  
  
if (a + b + 1) == s_len and a >= 1 and b <= 5:
  print 'Yes'
else:
  print 'No'

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
num = list(map(int, input().split()))
string = input()
length = num[0] + num[1] + 1
flag = False
for i in range(num[0]):
    if string[i].isdigit():
        flag = True
    else :
        flag = False
        break

if string[num[0]] == '-':
    for i in range(num[0] + 1, length):
        if string[i].isdigit():
            flag = True
        else:
            flag = False
            break
else:
    flag = False

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, raw_input().split())
# 文字列の入力
s = raw_input()
list = [ ]
list = s.split ( '-' )
if ( len(list[0]) == a and len(list[1]) == b):
    print "yes"
    exit()
print "no"

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, raw_input().split())
# 文字列の入力
s = raw_input()
list = [ ]
list = s.split ( '-' )
if ( len(list[0]) == a and len(list[1]) == b) :
           print "yes"
           exit()
print "no"

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
num = list(map(int, input().split()))
string = input()
length = num[0] + num[1] + 1
flag = False
for i in range(num[0]):
    if string[i].isdigit():
        flag = True
    else :
        flag = False
        break

if string[num[0]] == '-':
    for i in range(num[0] + 1, length):
        if string[i].isdigit():
            flag = True
        else:
            flag = False
            break

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import re
num = list(map(int, input().split()))
string = input()
length = num[0] + num[1] + 1
flag = False
for i in range(num[0]):
    if string[i].isdigit():
        flag = True
    else :
        flag = False
        break

if string[num[0]] == '-':
    for i in range(num[0] + 1, length):
        if string[i].isdigit():
            flag = True
        else:
            break

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

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split()))
s = input()
ans = s[a:b]
lengh = a+b+1
match = 0
match += s.count('1')
match += s.count('2')
match += s.count('3')
match += s.count('4')
match += s.count('5')
match += s.count('6')
match += s.count('7')
match += s.count('8')
match += s.count('9')
match += s.count('0')

if len(s) == a+b+1:
    if ans == '-':
        if s.count("-") == 1:
            if match == a+b:
                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 = input()
ans = "Yes"
if S[A] != "-":
    ans = "No"
if any([c == '-' for c in S[:A]]):
    ans = "No"
if any([c == '-' for c in S[B:]]):
    ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split()))
s = input()
ans = s[a:b]
lengh = a+b+1
match = 0
match += s.count('1')
match += s.count('2')
match += s.count('3')
match += s.count('4')
match += s.count('5')
match += s.count('6')
match += s.count('7')
match += s.count('8')
match += s.count('9')
match += s.count('0')
print(match)
if len(s) == a+b+1:
    if ans == '-':
        if s.count("-") == 1:
            if match == a+b:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#-*- coding:utf-8 -*-

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = input()
ans = "Yes"
digit = [chr(ord('0') + i) for i in range(10)]
if S[A] != "-":
    ans = "No"
if not all([c in digit for c in S[:A]]):
    ans = "No"
if not all([c in digit for c in S[B:]]):
    ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
def check_int(num):
    try:
        int(num)
        return True
    except:
        return False

raw_input()
s = raw_input().split("-")
if len(s) != 2:
    print 'No'
else:
    flag = True
    for i in s:
        if not check_int(i):
            flag = False
    if flag:
        print 'Yes'
    else:
        print 'No'

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = input()
ans = "Yes"
digit = [ord('0')+i for i in range(10)]
if S[A] != "-":
  ans = "No"
if not all([c in digit for c in S[:A]]):
  ans = "No"
if not all([c in digit for c in S[B:]]):
  ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
S = input()
ans = "Yes"
if S[A] != "-":
  ans = "No"
if not S[:A].isdigit():
  ans = "No"
if not S[B:].isdigit():
  ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
import re

[A, B] = map(int,raw_input().split())
S_array = list(raw_input())

i = 0
ret = "Yes"

while i < len(S_array):
    item = S_array.pop(0)
#    print item
    if(i < A):
        if re.match('-', item):
            ret = "No"
            break
    if(i == A):
        if re.match("[^-]", item):
            ret = "No"
            break

    if(i > A):
        if re.match("-", item):
            ret = "No"
            break

    i = i + 1


print ret

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
for i in range(b):
    if s[-1-i] =='-':flag = False
if s[a] != '-' : flag = False
print( "Yes" if flag else "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
for i in range(b):
    if s[-i] =='-':flag = False
if s[a] != '-' : flag = False
print( "Yes" if flag else "NO")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a,b = map(int,input().split())
S = str(input())
ans = str(S[a])
if "-"== ans:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

if S[A] != '-':
    print "No"

elif (A != 0) and (S[0:A] in "-"):
    print "No"

elif (B != 0) and (S[A+1:len(S)] in "-"):
    print "No"

else:
    print "Yes"

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if len(s) == a+b+1:
    if ans == '-':
        if s.count("-") == 1:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")