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:
#!/usr/bin/python

import re
import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        A, B = map(lambda x: int(x), line.rstrip("\n").split(" "))
        S = sys.stdin.readline().rstrip("\n")
        pattern = "\d{{{0}}}-\d{{{1}}}$".format(A, B)
        if re.match(pattern, S):
            print "Yes"
        else:
            print "No"

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)

Submission status: Accepted

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

a, b = map(str, input().split())
pattern = r"^\d{" + a + "}-\d{" + b + "}$"
repattern = re.compile(pattern)

rematch = repattern.match(input())

if rematch == None:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import re
a,b = map(int, input().split(" "))
c = list(input())
flag = 1
for i in range(a):
    if(re.match(r"\d",c[i])):
        pass
    else:
        flag = 0
if(re.match(r"-",c[a])):
    pass
else:
    flag = 0
for i in range(b):
    if(re.match(r"\d",c[a+1+i])):
        pass
    else:
        flag = 0
if(flag):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
a, b = map(int, raw_input().split())
s = raw_input()
num = [str(i) for i in xrange(10)]
for i in xrange(a):
    if not s[i] in num:
        print "No"
        sys.exit()

if not s[i+1] == "-":
    print "No"
    sys.exit()

for i in xrange(b):
    if not s[i+a+1] in num:
        print "No"
        sys.exit()

print "Yes"

Submission status: Accepted

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

    ab = S.split('-')
    if len(ab) == 2 and len(ab[0]) == A and len(ab[1]) == B:
        if ab[0].isdigit() and ab[1].isdigit():
            print('Yes')
            return
    print('No')

main()

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
S = input()
if len(S) != A + B + 1:
    print('No')
    sys.exit()
for i, s in enumerate(S):
    if i < A:
        if s not in '0123456789':
            print('No')
            sys.exit()
    elif i == A:
        if s != '-':
            print('No')
            sys.exit()
    else:
        if s not in '0123456789':
            print('No')
            sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
import sys
a, b = map (int, sys.stdin.readline().split())
s = sys.stdin.readline().strip()
ok = 0
if s[a] == '-':
  t = s.split('-')
  if len (t) == 2:
    if len (t[0]) == a and len (t[1]) == b:
      ok = 1

print (["No", "Yes"][ok])

Submission status: Accepted

Solution code:
import re

def getInput():
    """

    :return: list of list of str. 1st dim: row, 2nd dim: column.
    """
    separator = ' '
    ret_array = []
    while True:
        try:
            row = input().split(sep=separator)
            ret_array.append(row)
        except EOFError:
            break
    return ret_array


g = getInput()

A, B = map(int, g[0])
S = g[1][0]
p = '[0-9]{{{0}}}-[0-9]{{{1}}}'.format(A, B)
if re.match(p, S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
n = list(range(10))
if s[a] == '-':
    ss = s.split('-')
    try:
        int(ss[0])
        int(ss[1])
        print('Yes')
    except:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
for i in range(A + B + 1):
    if (i < A or 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=input().split(' ')
S=input()
A=int(A)
B=int(B)
if S[0:A].isdigit()==True and S[A]=='-' and S[A+1:].isdigit()==True:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

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

m=re.fullmatch('\d{'+a+'}-\d{'+b+'}',s)
print('No' if m is None else 'Yes')

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

print("Yes")

Submission status: Accepted

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

def isNum(c):
    return ord('0') <= ord(c) and ord('9') >= ord(c)
flag = True
for c in S[:A]:
    if not isNum(c):
        flag = False
        break
if S[A] != '-':
    flag = False
for c in S[A+1:]:
    if not isNum(c):
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding:utf-8                                                                                     

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

flag = False
if S[A] == '-':
    Ss = S.split('-')
    if len(Ss) == 2:
        if len(Ss[0]) == A and len(Ss[1]) == B:
            if Ss[0].isdigit() and Ss[1].isdigit():
                flag = True

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
S = input()
flag = True
if S[A] != "-":
    flag = False
else:
    for i in range(len(S)):
        if i != A and not S[i].isdigit():
            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()

data = S.split('-')

if len(data) != 2:
    print('No')
else:
    if len(data[0]) == A and len(data[1]) == B:
        if data[0].isdigit() and  data[1].isdigit():
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def is_good(s, sz):
    if len(s) != 2:
        return False
    if len(s[0]) != sz[0] or len(s[1]) != sz[1]:
        return False
    return True

sz = list(map(lambda x: int(x), input().split(' ')))
s = input().split('-')

if is_good(s, sz):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

    al = [str(i) for i in range(0, 10)]

    f = 1
    for x in range(len(s)):
        if x == a:
            if s[x] == "-":
                f = 1
            else:
                f = 0
                break
        else:
            if s[x] not in al:
                f = 0
                break

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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

if not S[:A].isdigit():
    print("No")
elif S[A] != "-":
    print("No")
elif not S[A+1:].isdigit():
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def solve(a, b, s):
    for i in range(len(s)):
        if i == a:
            if s[i] != "-":
                return 0
        else:
            if "0" <= s[i] <= "9":
                pass
            else:
                return 0
    return 1

a, b = [int(x) for x in sys.stdin.readline().strip().split()]
s = sys.stdin.readline().strip()

if solve(a, b, s):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n, m= list(map(int, input().split()))
a = list(input())
dig = "1234567890"
ans = "Yes"
for i in range(n):
    if a[i] not in dig:
        ans = "No"
if a[n] != "-":
    ans = "No"
for l in range(n+1, n+m+1):
    if a[l] not in dig:
        ans = "No"
print(ans)

Submission status: Accepted

Solution code:
temp=input().split(" ")
temp=list(map(int,temp))
a=temp[0]
b=temp[1]
temp=input().split("-")
if len(temp)!=2:
    print("No")


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

Submission status: Accepted

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

S = input()

def it():
  try:
    for c in S[:A]:
      yield int(c) in range(10)
    yield S[A] == '-'
    for c in S[A+1:]:
      yield int(c) in range(10)
  except ValueError:
    yield False

print('Yes' if all(it()) else 'No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import re

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

    pattern = r"\A[0-9]{{{}}}-[0-9]{{{}}}\Z".format(A, B)
    ok = re.fullmatch(pattern, S)

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

if __name__ == "__main__": main()

Submission status: Accepted

Solution code:
import sys

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

if (len(S) != A + B + 1):
    print('No')
    sys.exit()

ng = False
for i in range(A):
    n = ord(S[i]) - ord('0')
    if (n < 0 or n > 9):
        ng = True

for i in range(A + 1, A + B + 1):
    n = ord(S[i]) - ord('0')
    if (n < 0 or n > 9):
        ng = True

if (S[A] != '-'):
    ng = True

print('Yes' if not ng else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b=map(int,input().split())
s=input().split('-')
if len(s)!=2:
    print("No")
elif len(s[0])!=a or len(s[1])!=b:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

answer = True
for i in range(len(s)):
    if i == a:
        if s[i] != '-':
            answer = False
            break
    else:
        if s[i] == '-':
            answer = False
            break
        if int(s[i]) < 0 or int(s[i]) > 9:
            answer = False
            break

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

Submission status: Accepted

Solution code:
a, b = map(int, raw_input().split())
s = raw_input().split('-')
print 'Yes' if len(s[0]) == a and not [_ for _ in s[0] if _ not in '0123456789'] and \
               len(s[1]) == b and not [_ for _ in s[1] if _ not in '1234567890'] else 'No'

Submission status: Accepted

Solution code:
a, b = [int(x) for x in input().split()]
s = input()
pre, aft = s[:a], s[a+1:]
h = s[a]

ans = 'Yes'

if '-' in pre:
    ans = 'No'

if '-' in aft:
    ans = 'No'

if h != '-':
    ans = 'No'

if len(aft) != b:
    ans = 'No'

print(ans)

Submission status: Accepted

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

res = "Yes"

for i in range(A):
    if S[i] not in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]:
        res = "No"
if S[A] != "-":
    res = "No"
for i in range(A+1, A+B+1):
    if S[i] not in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]:
        res = "No"
print(res)

Submission status: Accepted

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

if "-" not in S:
    print("No")
elif S.count("-") > 1:
    print("No")
else:
    a,b = S.split("-")
    if (len(a) == A) and (len(b)==B):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    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:
#!/usr/bin/env python3

import string


def validate(a, b, s):
    if not s[a] == "-":
        return False
    for i in range(len(s)):
        if i != a and s[i] not in string.digits:
            return False
    return True


def main():
    a, b = (int(x) for x in input().split())
    s = input()
    print("Yes" if validate(a, b, s) else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
s = input()
def check(d):
    return all(c in "0123456789" for c in d)
print("Yes"*(s[a]=='-'and check(s[:a])and check(s[a+1:]))or"No")

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
S = input()
for i,c in enumerate(S):
    if i==A:
        if c!='-':
            print('No')
            exit()
    else:
        if c=='-':
            print('No')
            exit()
print('Yes')

Submission status: Accepted

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

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

	else:
		if not (S[i].isdigit()):
			print("No")
			exit(0)

print("Yes")

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
S = input()
def judge(A, B, S):
    if S[A] != '-':
        return False
    S = S[:A] + S[A+1:]
    num = '0123456789'
    for x in S:
        if x not in num:
            return False
    return True

if judge(A, B, S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
a,b=map(int,input().split())
s=input().split('-')
if len(s)!=2:
    print('No')
elif len(s[0])!=a or len(s[1])!=b:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

a, b = na()
s = ns().strip()
import re
if re.match("^[0-9]{" + str(a) + "}-[0-9]{" + str(b) + "}$", s):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#include <cstdio>
int A,B;
char s[12];
int main() {
  
  scanf ("%d%d",&A,&B);
  scanf ("%s",&s);
  for(int i=0;i<A;i++)if(!('0'<=s[i]&&s[i]<='9'))
  {
    puts("No"); return 0;
  }
  if(s[A]!='-')
  {
    puts("No"); return 0;
  }
  for(int i=A+1;i<=A+B;i++)if(!('0'<=s[i]&&s[i]<='9'))
  {
    puts("No"); return 0;
  }
  puts("Yes");
}

Submission status: Runtime Error

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

sa=s[:a]
sb=s[a+1:]

for i in range(a):
  if sa[i]=='-':
    print('No')
    sys.exit()
for j in range(b):
  if sb[i]=='-':
    print('No')
    sys.exit()
    
if s[a]!='-':
  print('No')
  sys.exit()
 
print('Yes')

Submission status: Runtime Error

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

sa=s[:a]
sb=s[a+1:]

for i in range(a):
  if sa[i].isdigit()==False:
    print('No')
    sys.exit()
for j in range(b):
  if sb[i].isdigit()==False:
    print('No')
    sys.exit()
    
if s[a]!='-':
  print('No')
  sys.exit()
 
print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
n = input()
if n[a]=="-":
  n = n.pop(a)
  if n.isdecimal():
    print("Yes")
    exit()
print("No")

Submission status: Runtime Error

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

print("Yes")

Submission status: Runtime Error

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

print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input().split()
b = input()
c = int(0)

for i in range(int(a[0])):
  if int(b[i]) <= 9 and int(b[i]) >= 0:
    pass
  else:
    c = 1

if b[int(a[0])] != "-":
  c = 1

for i in range(int(a[0]) + 1, int(a[0]) + int(a[1]) + 1):
  if int(b[i]) <= 9 and int(b[i]) >= 0:
    pass
  else:
    c = 1

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

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b = rm()
s = rr()
for i in range(a):
    if int(s[i]) not in range(10):
        print('No')
        exit()
for i in range(b):
    if int(s[a+1+i]) not in range(10):
        print('No')
        exit()
print('Yes')

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 and len(s)==2:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
S = input()
print ('Yes' if re.search(r'\A\d{{{}}}-\d{{{}}}\Z'.format(A, B), S) else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
AB = map(int, input().split())
S = list(map(str, input().split(-)))
ans = "No"
if AB[0] == len(S[0]):
    if AB[1] == len(S[1]):
        ans = "Yes"
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def actual(a, b, s):
    if s[a] != '-':
        return 'No'

    for i in range(0, a):
        if not '0' <= s[i] <= '9':
            return 'No'

    for j in range(a + 1, len(s) + 1):
        if not '0' <= s[j] <= '9':
            return 'No'

    return 'Yes'


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

print(actual(a, b, s))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
a,b = map(int,input().split())
s = list(input())
if s[a] != "-":
	print("No")
	sys.exit()
s.pop(s.index("-"))
for i in range(len(s)):
	if int(s[i]) >= 10 or int(s[i]) <= 0:
		print("No")
		sys.exit()
print("Yes")

Submission status: Runtime Error

Solution code:
    A, B = map(int, input().split())
    S = input()
    C = "1234567890"
    for i in range(len(S)):
        if i == A:
            if S[i] == "-":
                continue
            else:
                print("No")
                exit()
        else:
            if S[i] in C:
                continue
            else:
                print("No")
                exit()
    print("Yes")
resolve()

Submission status: Runtime Error

Solution code:
    A, B = map(int, input().split())
    S = input()
    C = "1234567890"
    for i in range(len(S)):
        if i == A:
            if S[i] == "-":
                continue
            else:
                print("No")
                exit()
        else:
            if S[i] in C:
                continue
            else:
                print("No")
                exit()
    print("Yes")
    exit()
resolve()

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
S = input()
C = "1234567890"
if S[A] == "-":
  for i in range(len(S)):
    if i != A-1:
      if A[i] in C:
        continue
      else:
        print("No")
        exit()
else:
  print("No")
  exit()
print("Yes")

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
S = input()
C = "1234567890"
if S[A] == "-":
  for i in range(len(S)):
    if i != A-1:
      if A[i] in C:
        continue
      else:
        print("No")
        exit()
else:
  print("No")

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	int a, b, flag=0;
	cin >> a >> b;
	string s;
	cin >> s;
	rep(i,a){
		if(!(s[i]>='0' && s[i]<='9')) flag++; 
	}
	if(s[a] != '-') flag++;
	loop(i, a+1, s.length()){
		if(!(s[i]>='0' && s[i]<='9')) flag++;
	}
	if(flag == 0) puts("Yes");
	else puts("No");
	return 0;
}

Submission status: Runtime Error

Solution code:
import re
a, b = [int(x) for x in input().split()]
s = input()
print("Yes" if re.search(f"\\d{{{a}}}-\\d{{{b}}}", s) is not None else "No")

Submission status: Runtime Error

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

ng = 0
if !(s[0:A].isdecimal()):
  ng = 1
if s[A] != "-": ng = 1
if !(s[A+1:A+B+1].isdecimal()):
  ng = 1
if ng == 1:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import re
a,b=map(int,input().split())
s=input()
if re.fullmatch([0-9]{a}-[0-9]{b},s)==True:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and '-' in s[a + 1:]
    flag2 = True
  
if flag1 and flag2:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
s = input()
try:
  ac, bc = int(s[:a]), int(s[a + 1:])
  flag = True
except ValueError:
  flag = False
print('Yes' if flag else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
flag = 1
a = "".join(S[:A])
b = "".join(S[A+1:])
if not(str.isdecimal(a)):
  flag = 0
if S[A] != "-":
  flag = 0
if not(str.isdecimal(b)):
  flag = 0
if flag == 1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections

#文字列を一文字ずつ取得したいとき
def inputStrOnebyOne():
    s = list(input())
    return s

#整数を一つずつリストに入れる
def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

def main():
    a,b = input().split()
    c,d = input().split("-")
    if a == str(len(c)) and b == str(len(d)):
        print("Yes")
    else:
        print("No")

if __name__=='__main__':
    main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

s = list(input())[::-1]

for _ in [0]*a:
  if not s.pop().isdigit():
    print("No")
    exit()
if s.pop() != '-'
    print("No")
    exit()

for _ in [0]*b:
  if not s.pop().isdigit():
    print("No")
    exit()
print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())
s = input()
num = '0123456789'
flg = 0
for i in range(len(s)):
  if i < n-1:
    if s[i] not in num:
      flg = 1
  elif i == a:
    if s[i] != '-':
      flg = 1
  else:
    if s[i] not in num:
      flg = 1
if flg == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

if S[B] == '-':
    for i in range(8):
        if i == B:
            continue
        else:
            if S[i] == '-':
                print('No')
                break
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

if S[B] == '-':
    for i in range(8):
        if i == B:
            continue
        else:
            if S[i] == '-':
                print('No')
                exit()
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

else:
  print("No")

Submission status: Runtime Error

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

if s.count("-") ==1:
  if a == len(s1) and b == len(s2):
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = [str(i) for i in range(10)]
flag = False
for i in range(A):
    if S[i] not in n:
        flag = True
        
if S[A] != '-':
    flag = True
    
for i in range(A+1, A+B+1):
    if S[i] not in n:
        flag = True
        
if flag:
    print('No')
else:
    print('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]=='-') and len(S)==(x+y+1):
    print('Yes')
else:
    print('No')

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]=='-') and len(S)==x+y+1:
    print('Yes')
else:
    print('No')