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:
def main():
    A, B = map(int, input().split())
    S = input()
    digit = [str(a) for a in range(10)]
    collect = True
    for i in range(len(S)):
        if i == A:
            if S[i] != "-":
                collect = False
                break
        else:
            if i not in digit:
                collect = False
                break
    if collect == True:
        print("Yes")
    else:
        print("No")
main()

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
S = input()
if len(S) == A+B+1:
    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())
S = input()
if len(S) == A+B+1 and S[A] == '-' and (S[0:A]+S[A+1:B]).isdecimal():
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import copy
a,b = map(int, input().split())
s = list(input())
tmp = copy.copy(s)
tmp.pop(a)
if 1 <= a and b <= 5 and a + b + 1 == len(s) and s[a] == '-' and ''.join(tmp).isnumeric():
    print('yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import copy
a,b = map(int, input().split())
s = list(input())
tmp = copy.copy(s)
tmp.pop(a)
if 1 <= a and b <= 5 and a + b + 1 == len(s) and s[a] == '-' and 'tmp'.join(tmp).isnumeric():
    print('yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=[int(i) for i in input().split()]
s=input()
ans=0
if s[a]!="-":
    ans+=1
else:
    front=s[:a]
    back=s[a+1:]
    if ("-" not in front) and ("-" not in front):
        pass
    else:
        ans+=1
if ans==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if len(''.join(s)) == a+b:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = input()
if 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 = list(input())
if 0 <= len(s) <= 9 and s[a] == "-" and s.count("-") == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a+b+1 >= 0 and a+b+1 <= 9:
    if "-" in s[a] and s.count("-") ==1:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import fractions
import copy
import bisect
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう
from operator import mul
from functools import reduce
from collections import Counter


N=3
M=3
i=0
j=0
k=0
n=3
r=1
a=[0]*5
b=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
c=[]
A,B=map(int, input().split())
#real=math.sqrt(N)
#r=int(input())
#print(real)
#print(M)
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"
s=input()
a=[i for i in s]
if a[A]!="-":
    print("No")
    sys.exit()


for i in range(A):
    #print(i)
    if not a[i] in b:
         print("No")
         sys.exit()

for i in range(B):
    #print(i+A)
    if a[i+A] in b:
         print("No")
         sys.exit()

print("Yes")

"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
    print(number_list[i-1])#

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''

#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''




#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値．桁ごとに分割したい．入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ

'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''


#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"


#a,b=map(int, input().split())  #int style 複数数値入力　「A B」みたいなスペース空いた入力のとき 

#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成


##############################################################################################
##############################################################################################
#under this line explains example calculation


#nCr combination
'''
def cmb(n,r):
    #When n < r , this function isn't valid
    r= min(n-r,r)
    #print(n,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    #flochart mul(n,n-1)=x
    #next     mul(x,n-2)........(n-r+1,n-r)
    #mul read a,b and returns a*b 

    under = reduce(mul, range(1, r+1))
    #print(over, under)
    #reduce is applied mul(1,2)=2
    #next   mul(2,3)=6
    #next   mul(6,4)=4.........last(r!,r+1)=r+1!

    return over // under
    #// is integer divide
    #calc example 5C2
    #over=5*4*3
    #under=3*2*1
a = cmb(n, r)
#print(a)
'''

'''
#集計
#example
#a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1]
#a=Counter(a)
for i in a.most_common(n):print(i)
#most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。
#引数にint型の数字nを設定した場合は、出現回数が高い上位ｎ個の要素を返します。
#何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。
#out put
#(2, 8)
 #(1, 6)
#(3, 3)
#(4, 1)
'''


#二部探索(binary search)
#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)
#index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている
#A.insert(index, 5)
#print(index)
#print(A)
'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''





########################################################################
########################################################################
#b2=a[:]  #1次元のときはコピーはこれで良い
#print(b2)

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b3=copy.deepcopy(a)  #2次元配列はこうコピーする
#print(b3)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import fractions
import copy
import bisect
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう
from operator import mul
from functools import reduce
from collections import Counter


N=3
M=3
i=0
j=0
k=0
n=3
r=1
a=[0]*5
b=[]
c=[]
A,B=map(int, input().split())
#real=math.sqrt(N)
#r=int(input())
#print(real)
#print(M)
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"
s=input()
a=[i for i in s]
if a[A]!="-":
    print("No")
    sys.exit()


for i in range(A):
    if a[i]!=1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9:
         print("No")
         sys.exit()

for i in range(B):
    if a[i+A+1]!=1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9:
         print("No")
         sys.exit()

print("Yes")

"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
    print(number_list[i-1])#

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''

#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''




#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値．桁ごとに分割したい．入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ

'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''


#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"


#a,b=map(int, input().split())  #int style 複数数値入力　「A B」みたいなスペース空いた入力のとき 

#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成


##############################################################################################
##############################################################################################
#under this line explains example calculation


#nCr combination
'''
def cmb(n,r):
    #When n < r , this function isn't valid
    r= min(n-r,r)
    #print(n,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    #flochart mul(n,n-1)=x
    #next     mul(x,n-2)........(n-r+1,n-r)
    #mul read a,b and returns a*b 

    under = reduce(mul, range(1, r+1))
    #print(over, under)
    #reduce is applied mul(1,2)=2
    #next   mul(2,3)=6
    #next   mul(6,4)=4.........last(r!,r+1)=r+1!

    return over // under
    #// is integer divide
    #calc example 5C2
    #over=5*4*3
    #under=3*2*1
a = cmb(n, r)
#print(a)
'''

'''
#集計
#example
#a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1]
#a=Counter(a)
for i in a.most_common(n):print(i)
#most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。
#引数にint型の数字nを設定した場合は、出現回数が高い上位ｎ個の要素を返します。
#何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。
#out put
#(2, 8)
 #(1, 6)
#(3, 3)
#(4, 1)
'''


#二部探索(binary search)
#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)
#index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている
#A.insert(index, 5)
#print(index)
#print(A)
'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''





########################################################################
########################################################################
#b2=a[:]  #1次元のときはコピーはこれで良い
#print(b2)

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b3=copy.deepcopy(a)  #2次元配列はこうコピーする
#print(b3)

Submission status: Wrong Answer

Solution code:
import re

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

pattern = '[0-9]{¥A}-[0-9]{¥B}'
result = re.match(pattern, S)


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

Submission status: Wrong Answer

Solution code:
import re

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

pattern = '[0-9]{A}-[0-9]{B}'
result = re.match(pattern, S)

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

Submission status: Wrong Answer

Solution code:
import re

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

result = re.match('[0-9]{A}-[0-9]{B}', S)

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

Submission status: Wrong Answer

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
def no():
    print("No")
    sys.exit()
a,b=map(int,input().split())
s=input()
num=[str(i) for i in range(1,10)]
if len(s)==a+b+1:
    for i in range(a):
        if s[i] not in num: no()
    if s[a]!="-": no()
    for i in range(a+1,a+b+1):
        if s[i] not in num: no()   

else: no()

print("Yes")

Submission status: Wrong Answer

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

if len(s)==a+b+1:
    if s[:a].isdecimal()==True and s[b:].isdecimal()==True:
        if s[a]=="-":
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

Submission status: Wrong Answer

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 i!="-":
      print("No")
      sys.exit()
  elif i not in nums:
    print("No")
    sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
S = input()
print(S[:A],S[A],S[B+1:])
if S[:A].isdigit() and S[A] == "-" and S[B:].isdigit():
    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[B:].isdigit():
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def Postal_Code(a , b , s):

    ans = "No"

    if s[:a].isdecimal() and s[b:].isdecimal() and s[a] == '-':
        ans = "Yes"

    return ans

def main():
    a , b = map(int , input().split())
    s = str(input())
    print(Postal_Code(a , b , s))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def Postal_Code(a , b , s):

    ans = "No"

    if s[:a].isdigit() and s[b:].isdigit() and s[a] == '-':
        ans = "Yes"

    return ans

def main():
    a , b = map(int , input().split())
    s = str(input())
    print(Postal_Code(a , b , s))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if len(content) == a + b + 1:
    A = content[:a]
    B = content[-b:]
    hyphn = content[a]
    print(A, B)
    if A.isdecimal() and B.isdecimal() and hyphn == '-':
        print('Yes')
    else :
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    A, B = map(int, input().split())
    postcode = input()
    answer = False
    if postcode.count("-") == 1:
        if postcode[A] == "-" and postcode[:A].isdecimal() and postcode[B:].isdecimal():
            answer = True
    print("Yes" if answer else "No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main():
    A, B = map(int, input().split())
    S = input().split('-')
    print('Yes'if all([s.isdigit() for s in S])and len(S) == 2 else 'No')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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


def main():
    A, B = input().split()
    S = input()
    pattern = r'\d{{0}}-\d{{1}}'.format(A, B)
    print('Yes'if not re.search(pattern, S) is None else 'No')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def is_number(num):
    try:
        int(num)
        return True
    except:
        return False

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
S=str(input())
T=sorted(S[:])
print(*T)
p=0
if (A+B+1)!=len(S):
  print("No")
else:
  if S[A]=="-":
    for i in range(1,len(S)):
      if 48<=ord(T[i])<=57:
        print(i,T[i],ord(T[i]))
        p=1
      else:
        p=0
        break
    #print(p)
    print("Yes" if p!=0 else "No")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
S=str(input())
T=sorted(S[:])
p=0
if (A+B+1)!=len(S):
  print("No")
else:
  if S[A]=="-":
    for i in range(1,len(S)):
      if 48<=ord(T[i])<=57:
        #print(ord(T[i]))
        p=1
      else:
        p=0
    #print(p)
    print("Yes" if p!=0 else "No")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
S=str(input())
T=sorted(S[:])
p=0
if S[A]=="-":
  for i in range(1,len(S)):
    if 48<=ord(T[i])<=57:
      #print(ord(T[i]))
      p=1
    else:
      p=0
  #print(p)
  print("Yes" if p!=0 else "No")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


for i in range(a+1,a+b+1):
    if i == a:
        if l[a] != "-":
            print("No")
            exit()
    else:
        if l[i] == "-":
            print("No")
            exit()
print("Yes")

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
import sys

a,b=map(int,input().split())
try:
	s=input()
	sa=int(s[:a])
	ss=s[a]
	sb=int(s[a+1:])
	if ss!='-':
		print("No")
		sys.exit()
	print("Yes")
except:
	print("No")

Submission status: Wrong Answer

Solution code:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B = map(int, readline().split())
S = readline().decode('utf8').rstrip()
T=S[:A]+S[A+1:]
bl = S[A] == '-' and '-' in T

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

Submission status: Wrong Answer

Solution code:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B = map(int, readline().split())
S = readline().decode('utf8').rstrip()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s1,s2 = s.split('-')
if a == len(s1) and b == len(s2):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

#s1,s2 = s.split('-')
#if a == len(s1) and b == len(s2):
#  print("Yes")
#else:
#  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a, b = map(int, input().split())
s = input()
flag = 0
for i in range(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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -coding: utf-8 -

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


isOUT = False
try:
    k = s[3]

    if k != "-":
        isOUT = True
except:
    isOUT = True
     
try:
    int(s[:3])
except:
    isOUT = True
    
try:
    int(s[3:])
except:
    isOUT = True

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