qyliang/CodeNanoFix huggingface dataset:
Buggy 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()


Fixed 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 len(tmp) != 2:
		print("No")
		sys.exit()
	
	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()
Buggy code:
# -*- coding: utf-8 -*-

import math

A,B = input().split(" ")
s = str(input())

s_sp = s.split("-")

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

if (len(s_sp[0]) != int(A)) | (len(s_sp[1]) != int(B)):
    print("No")
    exit

if ((s_sp[0].isdigit()) & (s_sp[1].isdigit())):
    print("Yes")
else:
    print("No")


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

import math
import sys

A,B = input().split(" ")
s = str(input())

s_sp = s.split("-")

if (len(s_sp) != 2):
    print("No")
    sys.exit()

if (len(s_sp[0]) != int(A)) | (len(s_sp[1]) != int(B)):
    print("No")
    sys.exit()

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

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

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


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

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


Fixed code:
a,b = map(int, input().split())
s =input()
if len(s) ==a+b+1 and s[a]=='-' and s.count('-')==1:
  print('Yes')
else:
  print('No')
Buggy 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')

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

if s.count('-')==1 and s[a]=='-':
    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')

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

Fixed code:
a, b = map(int, input().split())
s = input()
if s[:a].isdecimal() and s[a] == "-" and s[-b:].isdecimal():
    print("Yes")
else:
    print("No")
Buggy 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")

Fixed code:

A,B =map(int,input().split())
hih=0
num=1
test=1
S=str(input())
S= list(S)
for s in S:
    if num==A+1 and s=="-":
        hih=1
    if num!=A+1 and s=="-":
        test=0
        
    
    num+=1
if hih==1 and test==1:
    print("Yes")
else:
    print("No")
Buggy 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")

Fixed 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")
Buggy code:
a, b = map(int, input().split())
s = input()

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

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

if s.count('-') != 1:
    print("No")
else:
    for i in range(len(s)):
        if s[i] == '-' and i == a:
            print("Yes")
        elif s[i] == '-' and i  != a:
            print("No")
Buggy code:
a,b = map(int,input().split())
s = str(input())
if s[a]== '-' and len(s)==a+b+1:
    print('Yes')
else:
    print('No')

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

if s[a]== '-' and len(s)==a+b+1 and s.count('-')==1:
    print('Yes')
else:
    print('No')
Buggy 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")


Fixed code:
# -coding: utf-8 -

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

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

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

if isNo:
    print("No")
else:
    print("Yes")
Buggy code:
a,b = map(int, input().split())
s=input()

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


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

Fixed 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[1]) == b:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Buggy code:
a,b = map(int,input().split())
s = input()
if s[a] == '-' and len(s) == a+b+1:
    print('Yes')
else:
    print('No')

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

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



Fixed code:
a,b=map(int,input().split())
s=input()
f=0
for i in s:
    if i=="-":
        f+=1
if len(s)==(a+b+1) and s[a]=="-" and f==1:
    print("Yes")
else:
    print("No")
Buggy 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')

Fixed code:
import re

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

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


if result:
  print('Yes')
else:
  print('No')
Buggy code:
a,b=map(int,input().split())
N=list(str(input()))
if N[a]=="-":
  print("Yes")
else:
  print("No")

Fixed code:
a,b=map(int,input().split())
N=list(str(input()))
if N[a]=="-":
  N.pop(a)
  if "-" in N:
    print("No")
  else:
    print("Yes")
else:
  print("No")
Buggy code:
a,b = map(int,input().split())
s = input()
if s[a] == "-" and len(s) == a+b+1:
  print("Yes")
else:
  print("No")
  

Fixed 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")
Buggy code:
a,b = map(int,input().split())
s = input()
if s[a] == "-" and len(s) == a+b+1:
  if str.isdecimal(s[:a]) == True and str.isdecimal(s[a+1:]) == True:
    print("Yes")
else:
  print("No")

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

if len(s) == (a+b+1) and all([c != '-' for c in s[:a]+s[a+1:]]) and s[a] == '-':
  print('Yes')
else:
  print('No')

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

if len(s) == (a+b+1) and all([c != '-' for c in s[:a]+s[a+1:]]) and s[a] == '-':
  print('Yes')
else:
  print('No')
Buggy code:
a,b=[int(i) for i in input().split()]
s=input()
s2=s.split()
if s[a]=='-' and s2[0].isdigit() and s2[1].isdigit():
  print("Yes")
else:
  print("No")

Fixed code:
a,b=[int(i) for i in input().split()]
s=input()
s2=s.split("-")
if s[a]=='-' and s2[0].isdigit() and s2[1].isdigit():
  print("Yes")
else:
  print("No")
Buggy 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')


Fixed 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')
Buggy code:
a, b = [int(x) for x in input().split()]
s = input()
if s[a] == "-" and len(s) == (a+b+1):
  print("Yes")
else:
  print("No")

Fixed 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")
Buggy code:
a,b=map(int,input().split())
s=input()
if (len(s)==a+b+1)&(s[a]=='-'):
    print('Yes')
else:
    print('No')

Fixed code:
a,b=map(int,input().split())
s=input()
if (len(s)==a+b+1)&(s[a]=='-')&(s.count('-')==1):
    print('Yes')
else:
    print('No')
Buggy code:
a,b=map(int,input().split())
s=input()
if '-' not in s or s.count('-')>1 or s[0]==1 or s[-1]:
    print('No')
    exit()

p=s.split('-')
print('No' if s[a]!='-' or len(p[0]!=a or len(p[1])!=b) else 'Yes')

Fixed code:
a,b=map(int,input().split())
s=input()
if '-' not in s or s.count('-')>1 or s[0]=='-' or s[-1]=='-':
    print('No')
    exit()

p=s.split('-')
print('No' if s[a]!='-' or len(p[0])!=a or len(p[1])!=b else 'Yes')
Buggy code:
import re
a,b =[int(i) for i in input().split()]
content = input()
 
pattern = '[0-9]{a}-[0-9]{b}'
 
search_result = re.search(pattern, content)
 
if not(search_result) :
  print("No")
elif search_result.group() == content:
  print('Yes')
else:
  print("No")

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

pattern = '[0-9]{' +str(a)+ '}-[0-9]{' +str(b)+ '}'

search_result = re.search(pattern, content)

if not(search_result) :
  print("No")
elif search_result.group() == content:
  print('Yes')
else:
  print("No")
Buggy code:
a,b=map(int,input().split())
s=input()
print("True") if s[:a].isdigit() and s[a]=='-' and s[a+1:a+b+1].isdigit() else print("No")

Fixed code:
a,b=map(int,input().split())
s=input()
if s[:a].isdigit() and s[a]=='-' and s[a+1:a+b+1].isdigit():
    print("Yes")
else:
    print("No")
Buggy code:
A, B = map(int, input().split())
S = str(input())
s = list(S)
No = 0
for i in range(A):
    if s[i] == '-':
        print('No')
        No = 1
if No == 0:
    for i in range(B):
        if s[A + i] == '-':
            print('No')
            No = 1
if No == 0:
    if A + B + 1 == len(S) and s[A] == '-': print('Yes')
    else: print('No')


Fixed code:
A, B = map(int, input().split())
S = str(input())
s = list(S)
No = 0
if A + B + 1 != len(S):
    print('No')
    No = 1
if No == 0:
    for i in range(A):
        if s[i] == '-':
            print('No')
            No = 1
            break
if No == 0:
    for i in range(B):
        if s[A + i + 1] == '-':
            print('No')
            No = 1
            break
if No == 0:
    if s[A] == '-': print('Yes')
    else: print('No')
Buggy 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")


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

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

Fixed code:
a,b=map(int,input().split())
s=input()
print("Yes" if s.count("-")==1 and s.index("-")==a else "No")
Buggy code:
a, b = map(int, input().split())
s = input()
x=0
if s[a+1-1]=='-':
    for i in s:
        if i not in ('0','1','2','3','4','5','6','7','8','9','-'):
            x=0
            break
        else:
            x=1
else:
    x=0
if x==0:
    print('No')
elif x==1:
    print('Yes')

Fixed code:
a, b = map(int, input().split())
s = input()
s1=[]
for k in s:
    s1.append(k)
x=0
if s1[a+1-1]=='-':
    s1.remove(s1[a])
    for i in s1:
        if i not in ('0','1','2','3','4','5','6','7','8','9'):
            x=0
            break
        else:
            x=1
else:
    x=0
if x==0:
    print('No')
elif x==1:
    print('Yes')
Buggy code:
a,b,s=open(0).read().split();a=int(a)
print("NYoe s"[s.count("-") and s[a]=="-"::2])

Fixed code:
a,b,s=open(0).read().split();a=int(a);print("NYoe s"[s.count("-")==1 and s[a]=="-"::2])
Buggy code:
a,b=map(int,input().split());s=input()
try:
  int(s[:a])
  int(s[a+1:])
  if s[a]=="-":
    print("Yes")
except:
  print("No")


Fixed code:
a,b=map(int,input().split());s=input()
try:
  int(s[:a])
  int(s[a+1:])
  print(["No","Yes"][s[a]=="-"])
except:
  print("No")
Buggy code:
import sys
A,B = [int(n) for n in input().split()]
# N = int(input())
S = str(input())
if(S[A] != "-"):
    print("No")
    sys.exit()
S = S[:A] + S[A+1:]
L = len(S)
table = [n for n in range(10)]
for s in S:
    if not( s in table):
        print("No")
        sys.exit()
print("Yes")


Fixed code:
import sys
A,B = [int(n) for n in input().split()]
# N = int(input())
S = str(input())
if(S[A] != "-"):
    print("No")
    sys.exit()
S = S[:A] + S[A+1:]
table = [str(n) for n in range(10)]
for s in S:
    if not( s in table):
        print("No")
        sys.exit()
print("Yes")
Buggy code:
a, b = map(int, input().split())
s = input()
first, second = s.split("-")
if len(first) == a and len(second) == b:
    print("Yes")
else:
    print("No")


Fixed code:
a, b = map(int, input().split())
s = input()
try:
    first, second = s.split("-")
    if len(first) == a and len(second) == b:
        print("Yes")
    else:  
        print("No")
except:
    print("No")
Buggy code:
# -*- coding: utf-8 -*-
import re
num = list(map(int, input().split()))
string = input()
length = num[0] + num[1] + 1
flag = False
for i in range(num[0]):
    if string[i].isdigit():
        flag = True
    else :
        flag = False
        break

if string[num[0]] == '-':
    for i in range(num[0] + 1, length):
        if string[i].isdigit():
            flag = True
        else:
            break

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

Fixed code:
# -*- coding: utf-8 -*-
num = list(map(int, input().split()))
string = input()
length = num[0] + num[1] + 1
flag = False

for i in range(num[0]):
    if string[i].isdigit():
        flag = True
    else :
        flag = False
        break

if string[num[0]] == '-' and flag:
    for i in range(num[0] + 1, length):
        if string[i].isdigit():
            flag = True
        else:
            flag = False
            break
else:
    flag = False

if flag == True:
    print("Yes")
else:
    print("No")
Buggy 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")

Fixed code:
from sys import stdin
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")
Buggy 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') 

Fixed code:
import re

A, B = map(int, input().split())
S = input()
print ('Yes' if re.search(r'\A\d{{{}}}-\d{{{}}}\Z'.format(A, B), S) else 'No')
Buggy code:
a,b = map(int,input().split())
s = str(input())
if s.count('_') == 1 and s[a]== '_':
    print("Yes")
else:
    print("No")

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

Fixed code:
a, b = map(int, input().split())
c = input()
print('Yes' if c[a] == '-' and c.count('-') == 1 else 'No')
Buggy 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')


Fixed 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:]).isdigit() else 'No')
Buggy code:
import re
a,b = list(map(int,input().split()))
s = input()
if re.match(r"[1-9]*",s[:a]):
  if s[a]=="-":
    if re.match(r"[1-9]*",s[(a+1):]):
      print("Yes")
      exit()
print("No")

Fixed code:
import re
a,b = list(map(int,input().split()))
s = input()
if re.search(r"[0-9][0-9]*",s[0:a]):
  if s[a]=="-":
    if re.search(r"[0-9][0-9]*",s[(a+1):]):
      print("Yes")
      exit()
print("No")
Buggy code:
A,B = map(int,input().split())
S = input()
if S.count('-')==1 and s[A]=='-':
    print('Yes')
else:
    print('No')


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

def check(string):
    if '-' in string:
        print('No')
        quit()

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

check(S[:A])
rev_S = S[::-1]
print(rev_S)
check(rev_S[:B])

print("Yes")


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

def check(string):
    if '-' in string:
        print('No')
        quit()

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

check(S[:A])
rev_S = S[::-1]
check(rev_S[:B])

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

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

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

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

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

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

print("Yes" if A+B+1==len(S) and flg_haihun and S[A]=="-" else "No")
Buggy code:
#coding:utf-8
a,b = (int(i) for i in input().split())
s = input()
print(a,b,s[0:a],s[a],s[a+1:])

a = int(a)
b = int(b)

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

Fixed code:
#coding:utf-8
a,b = (int(i) for i in input().split())
s = input()

a = int(a)
b = int(b)

if(len(s)==(a+b+1) and s[0:a].isdigit() and s[a]=="-" and s[a+1:].isdigit()):
    print("Yes")
else:
    print("No")
Buggy 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")

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

Fixed code:
A,B = map(int,input().split())
S = input()
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')
Buggy code:
a,b=map(int,input())
s=str(input())
if s[:a].isnumeric() and s[a]=="-" and s[a+1:].isnumeric():
    print("Yes")
else:
    print("No")

Fixed code:
a,b=map(int,input().split())
s=str(input())
if s[:a].isnumeric() and s[a]=="-" and s[a+1:].isnumeric():
    print("Yes")
else:
    print("No")
Buggy 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')

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

Fixed code:
a,b = map(int,input().split())
s = input()
if len(s)==a+b+1 and s[:a].isdigit() and s[a+1:].isdigit() and s[a]=='-':
    print("Yes")
else:
    print("No")
Buggy code:
# ABC084B - Postal Code
def main():
    A, B = tuple(map(int, input().split()))
    S = input().rstrip()
    flg = S[A] == "-" and all(i in "0123456789" for i in S[:A] + S[A + 1 :])
    print("YES" if flg else "NO")


if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()
Buggy code:
x,y=map(int, input().split())
S=input()
if len(S)==x+y and S[x]=='-':
  print('Yes')
else:
  print('No')

Fixed code:
x,y=map(int, input().split())
S=input()
if len(S)==x+y+1 and S[x]=='-' and S.count('-')==1:
  print('Yes')
else:
  print('No')
Buggy 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()


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


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

examB()