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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import re
a,b = map(int,input().split())
s = input()
if s[a]=='-' and re.fullmatch(r'\d+',s[:a]) and re.fullmatch(r'\d+',s[a+1:]):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys

a,b=map(int,input().split())
ss=input().strip()

if len(ss) != (a+b+1):
  print("No")
  sys.exit()

#a 3  123-345
nums=[0,1,2,3,4,5,6,7,8,9]

for i in range(len(ss)):
  if i==a:
    if ss[i]!="-":
      print("No")
      sys.exit()
  elif int(ss[i]) not in nums:
    print("No")
    sys.exit()
print("Yes")

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
S1,S2=input().split("-")
if len(S1)==A and len(S2)==B:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = list(map(int, input().split()))
s = input()
l = s.split("-")
if len(l) != 2:
  ans = "No"
elif len[0]==a and len[1] == b:
  ans = "Yes"
else:
  ans = "No"
print(ans)

Submission status: Runtime Error

Solution code:
a, b = [int(x) for x in input().split()]
num = '0123456789'
S = input()
flg = True
for i in len(S):
  if i == a:
    if not S[i] == '-':
      flg = False
  else:
    if not S[i] in num:
      flg = False
print('Yes' if flg else 'No')

Submission status: Runtime Error

Solution code:
a, b = [int(x) for x in input().split()]
num = '0123456789'
S = input()
flg = True
for i in len(S):
  if i == A:
    if not S[i] == '-':
      flg = False
  else:
    if not S[i] in num:
      flg = False
print('Yes' if flg else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if s[a] == '-':
    for i in range(a):
        if 0 <= int(s[i]) <= 9:
            for j in range(a+1,a+b+2):
                if 0 <= int(s[i]) <= 9:
                    print('Yes')
                    break
        break
    
else:
    print('No')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
s=input()
first,second = s.split("-")
answer = len(first) ==a and len(second) == b
answer = answer and "-" not in first and "-" not in second
print("Yes" if answer else "No")

Submission status: Runtime Error

Solution code:
print("Yes" if len(s) == a+b+1 and s[a] == "-" and s[a+1] != "-" and s[a-1] != "-" else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n = int(input())
c = []
s = []
f = []
for i in range(n-1):
  x,y,z = map(int, input().split())
  c += [x]
  s += [y]
  f += [z]
  
for i in range(n-1):
  ans = s[i]+c[i]
  for j in range(i+1, n-1):
    ans = (ans//f[j]) * math.ceil(ans/f[j]) + c[j]
  print(ans)
print(0)

Submission status: Runtime Error

Solution code:
A, B = input().split()
S1, S2 = input().split("-")
print("Yes" if len(S1) == A and len(S2) == B else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
  a, b = map(int, input().split())
  s = input()
  for i in range(1, len(s)+1):
    if i == a+1:
      if s[i] != '-':
       	return False
    else:
      if s[i] == '-':
        return False
  return True

if __name__ == '__main__':
  if main():
    print('Yes')
  else:
    print('No')

Submission status: Runtime Error

Solution code:
# -coding: utf-8 -

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

if s[a] != "-":
    isNo = True
else:
    try:
        int(s[:a])
    except:
        isNo = True

    try:
        int(s[a:])
    except:
        isNo = True

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

Submission status: Runtime Error

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

if len(s[:s.index("-")])!=a:
    ans="No"
elif len(s[s.index("-")+1:])!=b:
    ans="No"
else:
    ans="Yes"
    
print(ans)

Submission status: Runtime Error

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

for i in range(a):
    if int(s[i]) in range(0, 10):
        cnt += 1
if s[a]=='-':
    cnt += 1
for i in range(b):
    if int(s[a+1+i]) in range(0, 10):
        cnt += 1

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

Submission status: Runtime Error

Solution code:
import sys

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

str_len = len(S)

for i in range(str_len):

    a = S[i]
    if i==A:
        if a=="-"
            break
        else:
            print("No")
            sys.exit()
    if str.isdecimal(a)==False:
        print("No")
        sys.exit()
print("Yes")

Submission status: Runtime Error

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

S =  input()


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

print(ans)

Submission status: Runtime Error

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

ans = 0

if S.count("-") == 1 and S[A] == "-":
    ans = ans + 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
S = input()
if S.index("-") == A:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

else:
    print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def examB():
    A, B = LI(); St = S()
    nums = list(map(str, range(10)))
    ans = "Yes"
    if St[A] == "-":
        for s in S[:A] + S[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: Runtime Error

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+b)-a-1)+i]=="-":
    print("No")
    exit()

print("Yes")

Submission status: Runtime Error

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[b+i]=="-":
    print("No")
    exit()

print("Yes")

Submission status: Runtime Error

Solution code:
1 2
7444

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# B
a, b = map(int, input().split())
s = input()
n = len(s)
nums = list(range(10))
point = 0
flag = 'Yes'

if n != a+b+1:
    flag = 'No'
    print(flag)
    exit()

while point<=n-1:
    if point == a:
        if s[point] != '-':
            flag = 'No'
    else:
        if int(s[point]) not in nums:
            flag = 'No'
    point += 1
print(flag)

Submission status: Runtime Error

Solution code:
# B
a, b = map(int, input().split())
s = input()
n = len(s)
nums = list(range(10))
point = 0
flag = 'Yes'

while (0<=point<=n-1):
    if point == a:
        if s[point] != '-':
            flag = 'No'
    else:
        if int(s[point]) not in nums:
            flag = 'No'
    point += 1
print(flag)

Submission status: Runtime Error

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: Runtime Error

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")
  if i!=A and int(S[i])>=10:
    print("No")
print("Yes")

Submission status: Runtime Error

Solution code:
import re
a, b = map(int, input().split())
s = input()
p1 = "\d{"+ str(a) +"}"
p2 = "\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: Runtime Error

Solution code:
a, b = map(int, input().split())
s = input()
l = list(range(10))
for i in range(len(s)):
    if i == 3:
        if s[i] != "-":
            print("No")
            exit()
    else:
        if int(s[i]) not in l:
            print("No")
            exit()
print("Yes")

Submission status: Runtime Error

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())
A,B=input().split("-")
if len(A)==a and len(B)==b:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if int(''.join(s[0:a])) >= 0 and s[a]=='-' and int(''.join(s[a+2:a+b+1])) >= 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

if int(''.join(s[0:a])) >= 0 and s[a]=='-' and int(''.join(s[a+2:])) >= 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
dic={}
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]+=1
  else:
    dic[r]=1

n=int(input())
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]-=1
  else:
    dic[r]=-1

print(max(dic.values(),0))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main(a,b,s):
  if len(s) != a+1+b :
    return 'No'
 
  for n,i in enumerate(s) :
    if n == a :
      
      if i != '-' :
        return 'No'
    else :
      try :
        int(i)
      except :
        return 'No'
  return 'Yes'
              
print(main(a,b,s))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
t=input()

s.sort()
s=''.join(s)#辞書順最小=辞書で一番最初

t.sort()
t.reverse()
t=''.join(t)#辞書順最大

if s<t:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
a, b = input().split("-")
print ("Yes" if len(a) == A and len(b) == B else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
s=input()
ans="Yes"
if s.count("-")!=1:
    ans="No"
else:front,back=s.split("-")
if len(front)!=a or len(back)!=b:
    ans="No"
print(ans)

Submission status: Runtime Error

Solution code:
# ABC084-B
A, B = map(int, input().split())
S = input()
ans = 'No'
flag = True
num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
if S[A] == '-':
    aa = S[0:A]
    bb = S[A+1:A+B+1]
    for i in range(len(aa)):
        if aa[i] not in num:
            flag  = False
    for k in range(len(bb)):
        if bb[i] not in num:
            flag = False
    if flag:
        ans = 'Yes'
print(ans)

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    long long a, b;
    string s;
    
    cin >> a >> b;
    cin >> s;
    
    for(int i = 0; i < a + b + 1; i++){
        if(i == a){
            if(s[i] != '-'){
                cout << "No" << endl;
                return 0;
            }
        }
        else{
            if(!(s[i] <= '9' && s[i] >= '0')){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    
    cout << "Yes" << endl;
    
    return 0;
}

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
a,b = int(input().split('-'))
if len(a) == A and len(b) == B:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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')<=ord(str(i))<=ord('9'):
            print("No")
            exit()
print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
#print(ab)
x=input()
#print(x)
x1=x[:a]
x2=x[a]
x3=x[a+1:a+b+1]
if x2=="-" and  all(int(x1[i])>=0 and int(x1[i])<=9 for i in range(a)) and all(int(x3[j])>=0 and int(x3[j])<=9 for j in range(b)):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a, b = [int(i) for i in input().split()]
s = input()
s_top = int(s[:a])
s_middle = s[a:a+1]
s_under = int(s[a+1:a+b+1])
if(s_top >= pow(10, a-1) and s_top < pow(10, a)) and s_middle == '-' and (s_under >= pow(10, b-1) and s_under < pow(10, b)):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

for i in s:
    if int(s)>= 0 and int(s)<= 9:
        num += 1

if a + b == num and s[a] == '-':
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
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: Runtime Error

Solution code:
A,B =map(int,input().split())
hih=0
num=1
JG=1
S=int(input())
S= list(str(S))
for s in S:
    if s=="-":
        hih=num 
    num+=1
for s in S:
    if s=="0" or s=="1" or s=="2" or s=="3" or s=="4" or s=="5" or s=="6" or s=="7" or s == "8" or s=="9":
    else:
        JG=0
if hih==A & JG==1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b =map(int,input().split())
c =int(input())
ans=True
if range(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: Runtime Error

Solution code:
a,b =map(int,input().split())
c =int,input()
ans=True
if range(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: Runtime Error

Solution code:
a,b =map(int,input().split())
c =map(int,input().split())
ans=True
if range(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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

def solve():
    A, B = list(map(int, input()))
    S = input()

    for i in range(len(S)):
        if i == A:
            if S[A] == "-":
                continue
            print("No")
            return 
        try:
            num = int(S[i])
        except:
            print("No")
            return
    print("Yes")

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
	
def main():
	A, B = map(int, input().split(" "))
	S = input()
	tmp = S.split("-")
	
	if tmp[0].isdecimal() == False or tmp[1].isdecimal() == False:
		print("No")
		sys.exit()
	
	if len(tmp[0]) == A and len(tmp[1]) == B:
		print("Yes")
	else:
		print("No")
	
	
if __name__ == "__main__":
	main()

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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

s = input()
n = s[:a]+s[a+1:]

print("Yes" if s[a]="-" and n.isdigit() else "No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
S=input()
flag=False
for i in range(len(S)):
  if i!=A and (S[i]-'0'<0 or 9<S[i]-'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: Runtime Error

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

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

Submission status: Runtime Error

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+1):
        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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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(input()))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split());c,d=input().split("-");print("Yes"len(c)==a and len(d)==b else"No")

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std; 

int main(){
    int a,b;
    cin >> a >> b;
    string S;
    cin >> S;

    if(S[a]!='-'){
        cout << "No" << endl;
        return 0;
    }

    if(S.size()-(a+1)==b) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Submission status: Runtime Error

Solution code:
a,b = map(int,input())
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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = int(input())
s = input()
l = [str(i) for i in range(10)]
for i in range(a):
    if not s[i] in l:
        print('No')
        exit()
for i in range(b):
    if not s[a+i] in l:
        print('No')
        exit()
if not s[a]=='-':
    print('No')
    exit()
print('Yes')

Submission status: Runtime Error

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")
elif sum(a) == len(b[1]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
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: Runtime Error

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


if S.count("-") == 1:
    s1,s2 = S.split("-")
    result = re.match(f"^[0-9]", s1)

    for x in range(2):
        if x == 1:
            result = re.match(f"^[0-9]", s2)
        if result:
            continue
        else:
            print("No")
            sys.exit(0)

    judgment = s1
    n = A
    for x in range(2):
        if x == 1:
            judgment = s2
            n = B
        if len(judgment) == n:
            continue
        else:
            print("No")
            sys.exit(0)

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

Submission status: Runtime Error

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


if S.count("-") == 1:
    s1,s2 = S.split("-")
    result = re.match(f"^[0-9]", s1)

    for x in range(2):
        if x == 1:
            result = re.match(f"^[0-9]", s2)
        if result:
            continue
        else:
            print("No")
            sys.exit(0)

    judgment = s1
    n = A
    for x in range(2):
        if x == 1:
            judgment = s2
            n = B
        if len(judgment) == n:
            continue
        else:
            print("No")
            sys.exit(0)

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