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 = map(int, input().split())
s = 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:
a, b = map(int, input().split())
s = input()
if s[a] == "-" :
    try :
        if (isinstance(int(s[:a]),int)) and (isinstance(int(s[a+1:]),int)) :
            print("Yes")
        else :
            print("No")
    except :
        print("No")
else :
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def examB():
    A, B = LI(); St = S()
    nums = list(map(str, range(10)))
    ans = "Yes"
    if St[A] == "-":
        for s in St[:A] + St[A + 1:]:
            if s not in nums:
                ans = "No"
                break
    else:
        ans = "No"
    print(ans)


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

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
    else:
        if(S[i].isdigit() != True):
            ans = False
if(len(S) != A + B + 1):
    ans = True
if(ans):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n, y = map(int, input().split())
bangou = input()

a_list = bangou.split('-')
if len(a_list) != 2:
    print('No')
elif len(a_list[0]) != n or len(a_list[1]) != y:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ab = [int(x) for x in input().split()]
s = input()
if s.count('-')!=1:
  print("No")
elif len(s[:s.index('-')])==ab[0] and len(s[s.index('-')+1:])==ab[1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
S=str(input())
if S[A]!="-" or S.count("-")!=1:
    print('No')
else:
    S_prime=S.split("-")
    S_leng=[len(str(i)) for i in S_prime]
    if S_leng==[A,B]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = list(input())
nums = list(map(str, range(10)))
if S[A] == "-":
    for char in S[:A] + S[A + 1:]:
        if char not in nums:
            print("No")
            break
    else:
        print("Yes")

else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

is_postal = 'Yes'

if s[a] != '-' or s.count('-') != 1:
    is_postal = 'No'

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

print(is_postal)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
p=input()
frag=True
if len(p)!=a+b+1 or p.count("-")!=1:
    frag=False
if p[a]!="-":
    frag=False
print("Yes" if frag==True else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
p=input()
frag=True
if len(p)!=a+b+1 or p.count("-")!=1:
    frag=False
if p[a]!="-":
    frag=False
print("Yes" if frag==True else "No")

Submission status: Accepted

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

ans = 'Yes'

for i in range(A):
  if not str.isdecimal(S[i]):
    ans = 'No'

if S[A] != '-':
  ans = 'No'
  
for i in range(B):
  if not str.isdecimal(S[-1*i-1]):
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b=map(int,input().split())
S=list(input())
ans='Yes'
for i in range(a+b):
    if i==a:
        if S[i]!='-':
            ans='No'
            break
        else:
            continue
    if S[i]=='0'or S[i]=='1' or S[i]=='2'or S[i]=='3' or S[i]=='4'or S[i]=='5' or S[i]=='6'or S[i]=='7' or S[i]=='8'or S[i]=='9':
        continue
    else:
        ans='No'
        break
print(ans)
#print(S)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    a,b=map(int, input().split())
    s=input()
    for c in s[:a]:
        if c.isdecimal():continue
        print("No")
        exit()
    if s[a]!="-":
        print("No")
        exit()
    for c in s[a+1:]:
        if c.isdecimal():continue
        print("No")
        exit()
    print("Yes")


main()

Submission status: Accepted

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

s = input()

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

Submission status: Accepted

Solution code:
import re
A, B = map(int, input().split())
S = input()
pattern = '[0-9]{' + str(A) + '}-[0-9]{'+ str(B) + '}'
result = re.search(pattern, S)
print('No') if result == None else print('Yes')

Submission status: Accepted

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

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

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

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(a+b+1):
    if i < a:
        if s[i] == '-':
            print('No')
            exit()
        else:
            continue
    elif i == a:
        if s[i] != '-':
            print('No')
            exit()
        else:
            continue
    else:
        if s[i] == '-':
            print('No')
            exit()
        else:
            continue

print('Yes')

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()
d=s[:a]+s[a+1:]
if s[a]=='-' and '-' not in d:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# import collections
# import math
import string
# import bisect
# import re
# import itertools
# import statistics

def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    s = sys.stdin.readline().rstrip()
    if s[a] == '-':
        s_a, s_b = s[:a], s[a+1:]
        for i in s_a:
            if not i in string.digits:
                f_a = False
                break
        else:
            f_a = True
            for i in s_b:
                if not i in string.digits:
                    f_b = False
                    break
            else:
                f_b = True
    else:
        print('No')
        exit()
    
    print('Yes' if f_a and f_b else 'No')

if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = input()
lis = [str(i) for i in range(10)]
for i in range(a+b+1):
  if i==a:
    if s[i]!="-":
      print("No")
      break
  else:
    if s[i] not in lis:
      print("No")
      break
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[-b:].isdecimal():
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

x=s[:a]
y=s[-b:]
ans=False
if s[a]=='-':
    if x.count('-') < 1 and y.count('-') < 1:
        ans=True

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

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 not S[i].isdecimal():
      print('No')
      exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

num = [str(x) for x in range(10)]

flag = False

if s[a] == "-":
    list_s = list(s)
    del list_s[a]
    if all([x in num for x in list_s]):
        flag = True
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input()
ans = "Yes"
flag1 = 0
flag2 = 0
if S[A] != "-":
    ans = "No"
else:
    for i in range(A):
        if S[i] == "-":
            ans = "No"
            flag1 = 1
            break
    for j in range(A+1,A+B+1):
        if S[j] == "-":
            ans = "No"
            flag2 = 1
            break
print(ans)

Submission status: Accepted

Solution code:
def exit_No():
  print("No")
  exit()

def isNotNum(s):
  return not (ord('0') <= ord(s) <= ord('9'))

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

# Main
for i in range(A):
  if isNotNum(S[i]):
    exit_No()
    
if S[A] != '-':
  exit_No()

for i in range(B):
  if isNotNum(S[A+1+i]):
    exit_No()
    
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:
A, B = tuple(int(num) for num in input().split())
S = input()

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=list(input())
s1=s.pop(a)
ans=1
for i in range(a+b):
    if s[i] not in "0123456789":
        ans=0
        break
print("Yes" if ans*(s1=="-") else "No")

Submission status: Accepted

Solution code:
import re
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()
if S[0:A].isdigit() and S[A]== "-" and S[A+1:A+B+1].isdigit():
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
S=input()
f=True
if len(S)!=A+B+1:
    f=False
num=[chr(i) for i in range(ord('0'),ord('9')+1)]
for i,c in enumerate(S):
    if (i!=A and c not in num) or (i==A and c!='-'):
        f=False
        break
print('Yes' if f else '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()
if s[a] != "-":
  print("No")
  quit()
for i in range(a+b+1):
  if i < a:
    if s[i] == "-":
      print("No")
      quit()
  if a < i:
    if s[i] == "-":
      print("No")
      quit()
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:
a, b = map(int, input().split())
s = input()
if not str.isdecimal(s):
    if str.isdecimal(s[:a]) and str.isdecimal(s[a + 1:]):
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    s = str(input().rstrip('\n'))
    d = collections.defaultdict(int)
    for i in range(10):
        d[str(i)]

    b = True
    for i in range(a + b + 1):
        if i < a:
            if s[i] not in d:
                b = False
                break
        elif i == a:
            if s[i] != "-":
                b = False
                break
        else:
            if s[i] not in d:
                b = False
                break
    if b:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

ans = "Yes"
for i in range(len(S)):
    if i == A and S[i] != "-":
        ans = "No"
        break
    if i != A and S[i] == "-":
        ans = "No"
        break
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

digits = [str(x) for x in range(10)]
for i in range(A):
  if S[i] in digits:
    pass
  else:
    print("No")
    exit()

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

for i in range(A+1, A+B+1):
  if S[i] in digits:
    pass
  else:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

flag = True
for i in range(a):
    if s[i] == '-':
        flag = False
        break

if s[a] != '-':
    flag = False

for i in range(b):
    if s[a+1+i] == '-':
        flag = False
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

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

# solve
ans = True
for i in range(A + B + 1):
    if i == A:
        if S[A] != '-':
            ans = False
            break
    else:
        if not S[i].isdigit():
            ans = False
            break

# output
print('Yes' if ans else 'No')

Submission status: Accepted

Solution code:
a,b=map(int,input().split());s=input()
print('YNeos'[s.count('-')!=1 or s[a] != '-'::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = [int(x) for x in input().split()]
S = input()
for i in range(A+B+1):
  if i==A and S[i]!="-":
    print("No")
    exit()
  if i!=A and (S[i]=="-" or int(S[i])>=10):
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input().strip()
flag = 0
for i in range(A+B+1):
    if i==A:
        if S[i]!="-":
            flag = 1
            break
    else:
        if not(48<=ord(S[i])<=57):
            flag = 1
            break
if flag==1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
a, b = map(int, input().split())
s = input()
p1 = r"\d{"+ str(a) +"}"
p2 = r"\d{"+ str(b) +"}"
if s[a] == "-" and re.fullmatch(p1, s[0:a]) != None and re.fullmatch(p2, s[a+1:]) != None:
        print("Yes")
else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B] = string_to_int(inputs[0])
    S = inputs[1]
    code = S.split('-')
    if len(code) != 2 or len(code[0]) != A or len(code[1]) != B:
        return 'No'
    return 'Yes'


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
S=input()
print('NYoe s'[S[A]=='-' and S.count('-')==1::2])

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 = map(int, input().split())
s = str(input())
if s[a]=='-':
    for i in range(a):
        if s[i]!='-':
            for j in range(a+1,a+b+1):
                if s[j]!='-':
                    print('Yes')
                    exit()
print('No')

Submission status: Accepted

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

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

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

    import re
    print('Yes' if re.compile('\d'*a + '-' + '\d'*b).match(s) else 'No')

bb084()

Submission status: Accepted

Solution code:
#!/usr/bin/python3

import sys
import re
# input = sys.stdin.readline
sys.setrecursionlimit(100000)
MOD = 10 ** 9 + 7

#N = int(input())
#A = [int(x) for x in input().split()]
#V = [[0] * 100 for _ in range(100)]

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

pat = '\d{{{}}}-\d{{{}}}'.format(A, B)
result = re.match(pat, S)

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

Submission status: Accepted

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

    if len(s) != a + b + 1:
        return False
    for i, c in enumerate(s):
        if i == a:
            if c != '-':
                return False
        elif not c.isdecimal():
            return False
    return True


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

Submission status: Accepted

Solution code:
import sys
A,B = map(int,input().split())
S = list(input())
if S[A] != "-":
    print("No")
    sys.exit()
j = [str(i) for i in range(10)]
if len(S) != len([i for i in S if i in j and i != A])+1:
    print("No")
    sys.exit()
print("Yes")

Submission status: Accepted

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

for i in range(a+b+1):
  if i == a and s[i] != '-':
    print('No')
    break
  elif i != a and s[i] == '-':
    print('No')
    break
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

if len(s) == a + b + 1 and re.match(r"[0-9]{" + str(a) + "}-[0-9]{" + str(b) + "}", s):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
S = input()
for i in range(len(S)):
    if i == A:
        if S[i] != '-':
            print('No')
            sys.exit()
    else:
        if S[i].isdigit() is False:
            print('No')
            sys.exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if S.count("-") == 1:
    hiphen = S.index("-")
    if A == hiphen and B == len(S) - 1 - hiphen:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

for i in range(len(s)):
    if i == a:
        if s[a] != "-":
            print("No")
            exit()
    else:
        if not "0" <= s[i] <= "9":
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())
S=input().split("-")
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()
if len(S)==A+B+1 and S[A]=='-' and S.count('-')==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=input()
wordlen=a+b+1
flag=0
for i in range(wordlen):
    if i==a:
        if s[i]!='-':
            flag+=1
    else:
        if s[i]=='-':
            flag+=1
if flag==0:
    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+1:].isdecimal() and s[a]=="-":
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

d = ('1','2','3','4','5','6','7','8','9','0')

for i in range(len(s)):
    if i == a and s[a:a+1] != '-':
        print('No')
        exit()
    if i != a and s[i:i+1] not in d:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=list(input())
if s.count('-')>1:
    print('No')
    exit()
print('Yes' if s.pop(a)=='-' and len(s)==a+b and all(0<=int(i)<10 for i in s) else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
A,B = input().split()
S = input()
pattern = '[0-9]{'+A+'}-[0-9]{'+B+'}'
result = re.match(pattern,S)
if result :
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

S_list = []
for s in S:
    S_list.append(s)

hy_count = S_list.count('-')

if count == A and hy_count == 1:
    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()
for i in range(len(s)):
    if i == a:
        if s[i] != '-':
            print('No')
            exit()
        else:
            continue

    if not '0' <= s[i] <= '9':
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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