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()
s_list = list(s)
if len(s) == (a+b+1) and s_list[a] == "-" and s.count("-") == 1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
# ABC 84, b - postal code
import re

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

Submission status: Wrong Answer

Solution code:
# ABC 84, b - postal code
import re

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
flag = True
for i, ss in enumerate(s):
  if i == a:
    if ss != '-':
      flag = False
  else:
    if ord(ss) not in range(ord('a'), ord('z')+1):
      flag = False

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
s = input()
flag = True
for i, ss in enumerate(s):
  if i == a:
    if ss != '-':
      flag = False
  else:
    if ss not in range(ord('a'), ord('z')+1):
      flag = False

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

#n = int(input())
#a = int(input())
a,b = list(map(int,input().split(" ")))
#ls = list(input().split(" "))
#ls = list(map(int,input().split(" ")))
#a,b = list(input().split())
string = input()
#ls = [int(input()) for i in range(n)]
try:
  int(string[0:a])
  int(string[a+1:a+b])
  if string[a] == "-":
    print("Yes")
  else:
    print("No")
except:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a,b = map(int,input().split())
s = input()
for i in range(a+b+1):
  if(s[i] == "-" and not(i == (a+2))):
    print("No")
    sys.exit()
print("Yes")

Submission status: Wrong Answer

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

if s.count("-") == 0 or s.count("-") > 1:
  print("No")
  exit()

if s[0] == "-" or s[-1] == "-":
  print("No")
  exit()

print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if S[A] == "-":
    haihun = True

for i in S[A+1:]:
    if i == "-":
        number = False
        break
    if int(i) < 0 or int(i) > 9:
        number = False
        break
    else:
        continue


if haihun and number:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

s = input()

if len(s) > 9:
    print("No")
    exit()

if s[a] != "-":
    print("No")
    exit()

if (s[:a] + s[a+1:]).isnumeric() != True:
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re
a,b=map(int,input().split())
s=input()
if re.search(r"^([0-9])*$",s[:a]) and s[a]=="-" and re.search(r"^([0-9])$",s[a+1:]) and len(s)==a+b+1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

lst = ['1','2','3','4','5','6','7','8','9']
ans = None

for i in range(a):
    if not s[i] in lst:
        ans = 'No'

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

for i in range(a+1,b):
    if not s[i] in lst:
        ans = 'No'

if not ans:
    ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
s = list(input())
index = 0
flg = False
if len(s) != a + b + 1:
  flg = True
while(index < a):
  if s[index] == '-':
    flg = True
    break
  index += 1
if s[index] != '-':
  flg = True
while(index < a + 1 + b):
  if s[index] ==  '-':
    flg = True
    break
if flg:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
ans = []

for i in range(len(s)):
    if s[i] == '0':
        ans.append('0')
    if s[i] == '1':
        ans.append('1')
    if s[i] == 'B':
        ans.pop(-1)

print(''.join(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
p=input().split()
A=int(p[0])
B=int(p[1])
S=input()
if S[A]=="-":
    t=S.split('-')
    if len(t)==2:
        a,b=int(t[0]),int(t[1])
        if 10**(A-1)<=a<10**A and 10**(B-1)<=b<10**B:
            print("Yes")
        else:
            print("No")
    else:
         print("No")
else:
     print("No")

Submission status: Wrong Answer

Solution code:
p=input().split()
A=int(p[0])
B=int(p[1])
S=input()
if S[A]=="-":
    t=S.split('-')
    if len(t)==2:
        a,b=int(t[0]),int(t[1])
        print(a)
        if 10**(A-1)<=a<10**A and 10**(B-1)<=b<10**B:
            print("Yes")
        else:
            print("No")
    else:
         print("No")
else:
     print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

left = s[0:a]
right = s[b:]
cop = str(left) + '-' + str(right)
if cop == s:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# class Node:
#     def __init__(self, data): #コンストラクタ
#         self.data = data #ノードがもつ数値
#         self.left = None #左エッジ
#         self.right = None #右エッジ
#
# class BST:
#     def __init__(self, number_list): #コンストラクタ
#         self.root = None #ルート初期化
#         for node in number_list: #数値を持つ配列から二分木を生成
#             self.insert(node) #挿入メソッドを使ってノードを挿入する
#
#     #挿入
#     def insert(self, data):
#         n = self.root #nにルートを代入
#         if n == None: #ルートに何も入っていない場合
#             self.root = Node(data) #ルートにノードを代入(二分探索木の一番上の部分が出来る)
#             return #呼び出し部分に戻る
#         else: #ルートノードに既に数値が入ってる場合
#             while True: #return等が入るまでずっと実行
#                 entry = n.data #entryにnが持つデータ(数値)を入れる
#                 if data < entry: #entryとdata(代入するデータ)を比較してentryの方が大きい場合
#                     if n.left is None: #nの左エッジに何も入っていない場合
#                         n.left = Node(data) #nの左エッジにdata(代入するデータ)を代入
#                         return ##呼び出し部分に戻る
#                     n = n.left #nの左に何か入っている場合nにnのleftを代入
#                 elif data > entry: #entryとdata(代入するデータ)を比較してentryの方が小さい場合
#                     if n.right is None: #nの右エッジに何も入っていない場合
#                         n.right = Node(data) #nの右エッジにdata(代入するデータ)を代入
#                         return #呼び出し部分に戻る
#                     n = n.right #nの右エッジに何か入っている場合nにnのrightを代入
#                 else: #上2つの条件分岐以外の場合
#                     n.data = data #nのdataにdata(代入するデータ)を代入
#                     return #呼び出し部分に戻る

a, b = map(int, input().split())
s = list(input())
no = 0
if s[a] != "-":
    print("No")
    no = 1
else:
    for i in s[:a] + s[a + 1::]:
        if not ("0" <= i <= "9"):
            print(i)
            print("No")
            no = 1
            break
if not no:
    print("Yes")

Submission status: Wrong Answer

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

flg ="Yes"

if n[a] != "-":
    flg ="No"

s = set([0,1,2,3,4,5,6,7,8,9])

if not (set(n[0:a]) | set(n[a+1:a+b+1])) <=s:
    flg = "No"

print(flg)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if '000' <= S[:A] < '999' and S[A] == '-' and '000' <= S[A+1:] <= '999':
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[0:A].isdecimal() != True:
    flag = False
elif S[A:B] != "-":
    flag = False
elif S[B:].isdecimal() != True:
    flag = False

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

Submission status: Wrong Answer

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

if len(S) != A+B+1:
    print("No")
else:
    for i in range(A):
        if S[i] == "-":
            print("No")
            break
        else:
            c += 1
if c == 1 :
    if S[A+1] != "-":
        print("No")
        c += 1
    else:
        for j in range(A+1,A+B+2):
            if S[j] == "-":
                print("No")
                c += 1
                break

if c == 1:
    print("Yes")

Submission status: Wrong Answer

Solution code:
A,B =map(int,input().split())
hih=0
num=1
S=str(input())
S= list(S)
for s in S:
    if num==A+1 and s=="-":
        hih=1
    num+=1
if hih==1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B =map(int,input().split())
hih=0
num=1
S=str(input())
S= list(S)
for s in S:
    if num==A and s=="-":
        hih=1
    num+=1
if hih==1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B =map(int,input().split())
hih=0
num=1
S=str(input())
S= list(S)
for s in S:
    if num==A and s=="-":
        hih=num
    num+=1
if hih==A:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B =map(int,input().split())
hih=0
num=2
S=str(input())
S= list(S)
for s in S:
    if s=="-":
        hih=num
    num+=1
if hih==A:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B =map(int,input().split())
hih=0
num=1
S=str(input())
S= list(S)
for s in S:
    if s=="-":
        hih=num
    num+=1
if hih==A:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
def ipt(N=0,switch=0):
    if N == 0:
        return list(map(int,input().split()))
    else:
        if switch==0:
            return [list(map(int,input().split())) for _ in range(N)]
        else:
            return [int(input()) for _ in range(N)]

a,b=ipt()
s=input()

flag=0
for i in range(a):
    if s[i] == "-":
        flag=1
        break

if s[a] != "-":
    flag=1
        
for i in range(a+1,b+1):
    if s[i] == "-":
        flag=1
        break
if flag==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if a+b+1 == len(s):
  ok = True
else:
  ok = False
  
for i in range(len(s)):
  if i == a:
    if s[i] != "-":
      ok = False
  else:
    if type(s[i]) != int:
      ok = False

if ok:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

if a+b+1 == len(s):
  ok = True
else:
  ok = False
  
for i in range(len(s)):
  if i == a:
    if s[i] != "-":
      ok = False
  if type(s[i]) != int:
    ok = False

if ok:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
s = list(input())
ans = "Yes"
for i in range(A+B+1):
    if 0 <= i < A or A < i <= B:
        if s[i] == "-":
            ans = "No"
            break
    if i == A:
        if s[i] != "-":
            ans = "No"
            break
if len(s) != A+B+1:
    ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
s = input()
ans = "Yes"
for i in range(A+B+1):
    if 0 <= i < A or A < i <= B:
        if s[i] not in "1234567890":
            ans = "No"
            break
    if i == A:
        if s[i] != "-":
            ans = "No"
            break
if len(s) != A+B+1:
    ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
s = input()
ans = "Yes"
for i in range(A+B+1):
    if 0 <= i < A or A < i <= B:
        if s[i] not in "1234567890":
            ans = "No"
            break
    if i == A:
        if s[i] != "-":
            ans = "No"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

a, b = map(int, input().split())
s = input()
  
try:
    fs = int(s[:a])
    if s[a] != '-':
        raise NotHyphenError()
    ls = int(s[a+1:-1])
    if len(str(ls)) == b:
        raise LenMissMatchError()
except:
    print('No')
    sys.exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

a, b = map(int, input().split())
s = input()
  
try:
    fs = int(s[:a])
    if s[a] != '-':
        raise NotHyphenError()
    ls = int(s[a+1:-1])
except:
    print('No')
    sys.exit()

print('Yes')

Submission status: Wrong Answer

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

if (len(S) != A+B+1) or "-" not in S:
    print("No")
    sys.exit()
try:
    a = int(S[:A])
    a = int(S[A+1:])
    print("Yes")

except:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if S[A-1] == '-':
    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: Wrong Answer

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

if S[A-1] == '-':
    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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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():
    flag = True
  else:
    flag = False

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

Submission status: Wrong Answer

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

#print(a, b)
#print(len(x))

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

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

Submission status: Wrong Answer

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('b')
    print('No')
    sys.exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if s[a+1] == "-":
    s2 = s[:a+1] + s[a+2:]
    for i in range(a+b):
        if s2[i] not in ["0","1","2","3","4","5","6","7","8","9"]:
            print("No")
            break
    else:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if s[a+1] == "-":
    s2 = s[:a+1] + s[a+2:]
    for i in range(a+b):
        if s2[i] not in range(10):
            print("No")
            break
    else:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if s[a+1] == "-":
    s2 = s[:a+1] + s[a+2:]
    for i in range(a+b):
        if s[i] not in range(10):
            print("No")
            break
    else:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if s[a+1] == "-":
    s2 = s[:a+1] + s[a+2:]
    for i in range(a+b):
        if s[i] not in range(10):
            print("No")
            break
    else:
        print("Yes")

Submission status: Wrong Answer

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(B,A+B+1):
  if j == B and S[j] != '-':
    print("No")
    exit()
  elif S[j] == '-':
    print("No")
    exit()
    
print("Yes")

Submission status: Wrong Answer

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

if "-" in s:
    try:
        s1,s2 = s.split("-")
        s1 = int(s1)
        s2 = int(s2)
        s1 = str(s1)
        s2 = str(s2)
        if len(s1) == a and len(s2) == b:
            print("Yes")
        else:
            print("No")
    except:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split());s=input();print(" YNeos"[len(s)<11*(s[a]=="-")::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 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: Wrong Answer

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]
print(rev_S)
check(rev_S[:B])

print("Yes")

Submission status: Wrong Answer

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

def check(string):
    if string in '-':
        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: Wrong Answer

Solution code:
A,B=(int(i) for i in input().split())
S=input()
if S[A]=='-':
  for i in range(A):
    if type(S[i])==int:
      for i in range(B):
        if type(S[i+A])==int:
          print("Yes")
        else:
          print("No")
    else:
      print("No")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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,flag2==0,flag3==0):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

try:
    if s[a] == '-' and int(s[:a]+s[(a+1):]):
        print('Yes')
    else:
        print('No')
except:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b,s=open(0).read().split();a=int(a)
print("NYoe s"[s.count("-") and s[a]=="-"::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if s[a] == '-':
    for i in range(a+b):
        if not s[i].isdecimal():
            break
    print('Yes')
    exit(0)
print('No')

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
S = str(input())
for i,s in enumerate(S):
    if not i == A and S[i] == '-':
        print("NO")
        exit()
print('YES' if S[A] == '-' and len(S) == A+B+1 else "NO")

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
S = input()
result = "No"
flag = True

if S.count("-") == 1 and (S.find("-") == 0 or S.find("-") == len(S)-1):
    flag = False
    if sum(a)+1 == len(S):
        result = "Yes"

elif S.count("-"):
    b = list(S.split("-"))
    a.sort()
    b.sort()

else:
    flag = False

if not flag == False:
    if a[0] == len(b[0]) and a[1] == len(b[1]):
        result = "Yes"

print(result)

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
S = input()
result = "No"
flag = True
if S.count("-"):
    b = list(S.split("-"))
    a.sort()
    b.sort()
elif S.count("-") == 1 and (S.find("-") == 0 or S.find("-") == len(S)-1):
    if sum(a) == len(S)+1:
        result = "Yes"
        flag = False
else:
    flag = False

if not flag == False:
    if a[0] == len(b[0]) and a[1] == len(b[1]):
        result = "Yes"

print(result)

Submission status: Wrong Answer

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

b = list(S.split("-"))

a.sort()
b.sort()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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