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: Accepted

Solution code:
A,B = [int(x) for x in input().split()]
S = input()
flag = True
for ind,i in enumerate(S):
  if(ind!=A):
      if(ord(i)<48 or 57<ord(i)):
         flag = False
         break
  else:
      if(i!='-'):
         flag = False
         break
if(flag):
     print('Yes')
else:
     print('No')

Submission status: Accepted

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

Submission status: Accepted

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

if S[A] == '-':
    for i in range(A):
        if S[i] == '-':
            bool = False
    
    for j in range(B):
        if S[-i] == '-':
            bool = False
else:
    bool = False
            
print('Yes' if bool else 'No')

Submission status: Accepted

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

if len(S) == A+B+1:
    for i in range(A+B+1):
        if i != A:
            if S[i] == '-':
                print('No')
                quit()
        else:
            if S[i] != '-':
                print('No')
                quit()
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
S = list(input())
ans = 0
if S.count('-') != 1 :
    ans -= 1
else :
    if S[a] != '-' :
        ans -= 1

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

Submission status: Accepted

Solution code:
import sys

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

for i in range(A+B+1):
    if i != A:
        if S[i] == '-':
            print('No')
            sys.exit()
    else:
        if S[i] != '-':
            print('No')
            sys.exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if(len(S) < A):
  judge = 0
for i in range(len(S)):
 if(i == A):
  if(S[i] != '-'):
    judge = 0
    break
 else:
  if(S[i] == '-'):
    judge = 0
    break
    
if(judge == 0):
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

s = S.split("-")
if S[A] == "-" and s[0].isdigit() and s[1].isdigit() and A == len(s[0]) and B == len(s[1]):
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

for i in range(A+1,A+1+B):
    if S[i] == "-":
        print("No")
        exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=list(str(input()))
flag=False
numls=[str(i) for i in range(10)]
if s[a]!="-":
    flag=True
else:
    for i in range(a-1):
        if s[i] not in numls:
            flag=True
    for j in range(b):
        if s[a+j+1] not in numls:
            flag=True
print("YNeos"[flag::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = list(input())
suji = [str(i) for i in range(0, 10)]
try:
    a = int("".join(S[:A]))
    b = int("".join(S[B:]))
    if (S[A] in suji):
        print("No")
    else:
        print("Yes")
except:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
S=input()
flag=False
for i in range(len(S)):
  if i!=A and ((ord(S[i])-ord('0'))<0 or 9<(ord(S[i])-ord('0'))):
    break
  if i==A and S[i]!='-':
    break
  
  if i==len(S)-1:
    flag=True
    
if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
ans = 'Yes'
if S[:A].isdecimal() == 0\
or S[A:A+1] != '-'\
or S[A+1:].isdecimal() == 0:
    ans = 'No'
print(ans)

Submission status: Accepted

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

if S.count('-') == 1: 
  code_1, code_2 = S.split('-')
  if (len(code_1) == A) and (len(code_2) == B):
    flag = True
  else:
    flag = False

  if (code_1+code_2).isdecimal() and flag:
    flag = True
  else:
    flag = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math


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

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

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    S = input()
    print('YNeos'[not(
        S[A] == '-' and
        len(S[:A]) == A and S[:A].isdecimal() and
        len(S[A + 1:]) == B and S[A + 1:].isdecimal()
    )::2])


main()

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    S = input()
    s = S.split('-')
    if len(s) != 2:
        print('No')
    else:
        x = s[0]
        y = s[1]
        print(
            'YNeos'[
                not (
                    len(x) == A and
                    len(y) == B and
                    x.isdecimal() and
                    y.isdecimal()
                )::2
            ]
        )


main()

Submission status: Accepted

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

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

print('Yes')

Submission status: Accepted

Solution code:
a,s=open(0);print('YNeos'[s.count('-')!=1or'-'<s[int(a[0])]::2])

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
if s[a] != '-':
    print("No")
else:
    found = True
    for i in range(len(s)):
        if i != a and not s[i].isdigit():
            found = False
    if found:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

flag = True
for i in range(len(S)):
    if i == A:
        if S[i] != '-':
            flag=False
    else:
        if S[i] not in '0123456789':
            flag=False

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
bango = ['0','1','2','3','4','5','6','7','8','9']
answer ='No'
count = 0
if s[a] == '-':
	s = s[:a]+s[a+1:]
	for i in range(len(s)):
		if s[i] in bango:
			count +=1
	if count == len(s):
		answer = 'Yes'
print(answer)

Submission status: Accepted

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

if "-" not in S or len(S.split("-")) > 2:
    print("No")
    exit()

left,right = S.split("-")

if len(left) == A and len(right) == B:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import re

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

m = re.match('[0-9]{{{0}}}-[0-9]{{{1}}}'.format(a, b), s)
print('Yes' if m else 'No')

Submission status: Accepted

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

if len(x) !=2:
  print("No")
  exit()

if len(x[0])==a and len(x[1])==b:
  print("Yes")
  exit()

print("No")

Submission status: Accepted

Solution code:
import sys
a, b = list(map(int,input().split()))
x = input()
if not (x[0:a].isdigit()) & (len(x[0:a]) == a):
    print('No')
    sys.exit()
if x[a] != '-':
    print('No')
    sys.exit()
if not (x[a+1:a+1+b].isdigit()) & (len(x[a+1:a+1+b]) == b):
    print('No')
    sys.exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

A, B = map(int, input().split())
S = input()
p = '\d{{{0}}}-\d{{{1}}}'.format(A, B)
m = re.match(p, S)
print('Yes' if m else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

pattern = '\d{' + str(a) + '}-\d{' + str(b) + '}'
if re.search(pattern, s) is None:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
Slist = list(map(ord, S))
del (Slist[A])

if S[A] == '-':
    if max(Slist) <= 57 and min(Slist) >= 48:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

S = input()

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

for j in range(A,A+B+1):
  if j == A and S[j] != '-':
    print("No")
    exit()
  elif j>A and S[j] == '-':
    print("No")
    exit()
  else:
      continue
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
num=[int(i) for i in range(10)]
ans='No'
ss=s[:a]+s[a+1:]
if s[a]=='-':
    if ss.isdecimal()==True:
        ans='Yes'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

A,B=map(int,input().split())
S=input()
f = r'^[0-9]{%d}-[0-9]{%d}$' % (A,B)
if re.search(f,S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge(a, b, s):
    num = [str(i) for i in range(10)]
    for i in range(a+b+1):
        if (s[i] in num and i != a)  or (s[a] == "-" and i == a):
            continue
        else:
            return "No"

    return "Yes"
            

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=(int(i) for i in input().split())
s=input().split('-')
if len(s)!=2:
    print('No')
elif len(s[0])!=a or len(s[1])!=b:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
S = input()
if len(S) == A + B + 1:
    cnt = 0
    for x in S:
        if  x == '-':
            cnt += 1
    if cnt == 1 and S[A] == '-':
        print("Yes")
        quit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

def check(string):
    if '-' in string:
        print('No')
        quit()

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

check(S[:A])
rev_S = S[::-1]
check(rev_S[:B])

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
a, b = [int(_) for _ in stdin.readline().rstrip().split()]
s = stdin.readline().rstrip()
substr = s[:a]+s[a+1:]
if s[a]=='-' and substr.isdigit():
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

x = -1 == s[0:a].find('-')
y = -1 == s[a+1:].find('-')
z = -1 != s[a]=='-'

#print((x,y,z))
print('Yes' if x and y and z else 'No')

Submission status: Accepted

Solution code:
def solve(string):
    a, b, s = string.split()
    a = int(a)
    return "Yes" if s[a] == "-" and (s[:a] + s[a + 1:]).isdigit() else "No"


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Submission status: Accepted

Solution code:
a,b=map(int,input().split());s=input().split("-");ans="Yes"
if len(s)!=2:ans="No"
if len(s[0])!=a or len(s[1])!=b:ans="No"
if "--" in s:ans=="No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input()
ans = 0
for i in range(A+B+1):
    if i < A:
        if ord(S[i]) >= 48 and ord(S[i]) <= 57:
            ans += 1
    elif i == A:
        if ord(S[A]) == 45:
            ans += 1
    else:
        if ord(S[i]) >= 48 and ord(S[i]) <= 57:
            ans += 1
if ans == A+B+1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=list(input())
if s[a]!='-':
  print('No')
  exit()
s.pop(a)
num=list('0123456789')
for i in range(a+b):
  if s[i] in num:
    continue
  else:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

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

ans = True
for i in range(len(S)):
    if i == A:
        if S[i] != "-":
            ans = False
            break
    else:
        if S[i] == "-":
            ans = False
            break

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

Submission status: Accepted

Solution code:
A ,B = map(int,input().split())
S = input()
if S.count("-") == 1 :
    M, N = S.split("-")
    print("Yes" if len(M) == A and len(N) == B else "No")
else :
    print("No")

Submission status: Accepted

Solution code:
import re
A,B=map(int,input().split(' '))
print('Yes') if len(re.compile(r'^[0-9]{%d}-[0-9]{%d}$' % (A,B)).findall(input()))==1 else print('No')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
print('NYoe s'[s.replace('-','').isdigit() and s.find('-')==a and len(s)==a+b+1 and s.count('-')==1::2])

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(S)):
    if i == A:
        if S[i] != "-":
            flag = False
            break
    else:
        if S[i] == "-":
            flag = False
            break

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

Submission status: Accepted

Solution code:
from collections import Counter

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

Submission status: Accepted

Solution code:
a=int(input()[0]);s=input();print("YNeos"[s.count("-")!=1or"-"<s[a]::2])

Submission status: Accepted

Solution code:
a=int(input()[0]);s=input();print("YNeos"[s.count("-")!=1or s[a]>"-"::2])

Submission status: Accepted

Solution code:
a=int(input()[0]);s=input();print("NYoe s"[a==s.find("-")==s.rfind("-")::2])

Submission status: Accepted

Solution code:
a=int(input()[0]);s=input();print("YNeos"[s[a]>"-"or"-"in s[:a]+s[a+1:]::2])

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
print("YNeos"[s[a]>"-"or"-"in s[:a]+s[a+1:]::2])

Submission status: Accepted

Solution code:
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B = IL()
s = S()

if s.count("-")==1 and s.index("-")==A:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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


c = 0

for i in range(a):
	if p[i] != '-':
		c += 1
        
if p[a] == '-':
	c += 1
    
for i in range(b):
	if p[a+1] != '-':
		c += 1
        
if c == a + b + 1:
	print('Yes')
    
else:
	print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
a, b = map(int, input().split())
s = input()
print('Yes' if re.match(r'^[0-9]{%s}\-[0-9]{%s}$' % (a, b), s) else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input()
if(S.count("-")>1):
  print("No")
elif(S[A] != "-"):
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
def postal_code(A: int, B: int, S: str)->bool:
    if '-' in S[:A]:
        return False
    if S[A] != '-':
        return False
    if '-' in S[-B:]:
        return False
    return True


if __name__ == "__main__":
    A, B = map(int, input().split())
    S = input()
    yes = postal_code(A, B, S)
    print('Yes' if yes else 'No')

Submission status: Accepted

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

h = s[a:a+1]
a = s[:a] 
b = s[-b:]

print("Yes") if a.isdigit() & b.isdigit() & (h == "-") else print("No")

Submission status: Accepted

Solution code:
def postal(a,b,s):
    if s[a]=='-':
        for i in (s[:a]+s[a+1:]):
            if i not in '0123456789':
                return 'No'
        return 'Yes'
    else:
        return 'No'
a, b = map(int, input().split())
s = input()
print(postal(a,b,s))

Submission status: Accepted

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

def f():
    if s.count("-") != 1:
        return "No"
    x = s.split("-")
    
    if len(x[0]) == a and len(x[1]) == b:
        return "Yes"
    return "No"

print(f())

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc084/tasks/abc084_b

import itertools
import collections
import bisect

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

    try:
        fir = int(S[:A])
        sec = int(S[B:])
    except ValueError:
        print("No")
        exit()

    if S[A] == '-':
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
hoge=input()
flag1=0
flag2=1
flag3=0
for i in range(a+b+1):
  if(hoge[i]=="-" and i<a):
    flag1=1
  if(hoge[i]=="-" and i==a):
    flag2=0
  if(hoge[i]=="-" and i>a):
    flag3=1

if(flag1==0 and flag2==0 and flag3==0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())
    S = str(input().strip())
    if S[:A].isnumeric() and S[A] == '-' and S[A+1:].isnumeric():
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input()
ans = True
for i in range(len(S)):
    if i == A:
        if S[i] != "-":
            ans = False
    elif "0" > S[i] or "9" < S[i]:
        ans = False
print("YNeos"[not ans::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = "No"
if(S[A] == "-"):
  if(S[:A].isdigit() and S[A+1:].isdigit()):
    ans = "Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
for a in range(A):
    if S[a] not in ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"):
        print("No")
        exit()
if S[A] != "-":
    print("No")
    exit()
for b in range(B):
    if S[A + 1 + b] not in ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"):
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = list(input())
judge = 0 #0:OK , -1:NG

if(len(S) == A+B+1):
 s1 = S[:A]
 s2 = S[A+1:]
 s3 = S[A]
 if('-' in s1):
   judge = -1
 elif('-' in s2):
   judge = -1
 else:
  if((len(s1)==A)and(len(s2)==B)and(s3=='-')):
   judge = 0
  else:
   judge = -1
else:
 judge = -1

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

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

A, B = map(int, input().split())
S = input()[:-1]
ans = "Yes"
if S.count("-") != 1:
    ans = "No"
elif not S[A] == "-":
    ans = "No"
elif len(S) != A+B+1:
    ans = "No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check(b):
    if not b:
        print('No')
        exit()
a, b = map(int, input().split())
s = input()
deg = '0123456789'
check(len(s) == a+b+1)
check(s[a] == '-')
for i in range(a+b+1):
    if i != a:
        check(s[i] in deg)
print('Yes')

Submission status: Accepted

Solution code:
# coding: utf-8
A, B = map(int, input().split())
S = input()
ans = 'Yes'
for i in range(A + B + 1):
    if i != A:
        if S[i] == '-':
            ans = 'No'
            break
    else:
        if S[i] != '-':
            ans = 'No'
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
nums=input()
s=input()
pfin=''
for idx,ns in enumerate(nums.split()):
  pttr='{},{}'.format(ns,ns)
  pfin+='\d{'+pttr+'}'
  if idx==0: pfin+='-'
print('Yes' if re.match(pfin,s) is not None else 'No')

Submission status: Accepted

Solution code:
import re
nums=input()
s=input()
pfin=''
for idx,ns in enumerate(nums.split()):
  pttr='{},{}'.format(ns,ns)
  pfin+='\d{'+pttr+'}'
  if idx==0: pfin+='-'
print('Yes' if re.match(pfin,s) is not None else 'No')

Submission status: Accepted

Solution code:
a,b=[int(i) for i in input().split()]
s=input()
num=[str(i) for i in range(10)]
result=False
for i in range(len(s)):
    if i==a:
        if s[i]!="-":
            result=True
    else:
        if (s[i] in num)==False:
            result=True
print("No" if result else "Yes")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
ans='No'
cnt=0
if s[a]=='-':
    s=s[:a]+s[a+1:]
    if '-' not in s:
        ans='Yes'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

a, b = map(int, input().split())
s = input()
m = re.match('\d{%d}-\d{%d}' % (a, b), s)
if m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

no = 0
for i in range(len(s)) :
    if i == a :
        if s[i] != "-" :
            no = 1
    else :
        if s[i] == "-" :
            no = 1

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