qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a, b = map(int, input().split())
s = input()
print(s[a])
if(s[a] == "-"):
    try:
        int(s[:a])
        int(s[a + 1:])
        print("Yes")
    except:
        print("No")
else:
    print("No")

Fixed code:
a, b = map(int, input().split())
s = input()
if(s[a] == "-"):
    try:
        int(s[:a])
        int(s[a + 1:])
        print("Yes")
    except:
        print("No")
else:
    print("No")
Buggy code:
a,b=map(int,input().split())
s=input()
t=True
if s[a]=="-":
    x,y=s[:a],s[a+1:]
    if len(x) != a or len(y) != b:
        t=False
else:
    t=False
print("Yes" if t else "No")

Fixed code:
a,b=map(int,input().split())
s=input()
t=True
if s[a]=="-":
    x,y=s[:a],s[a+1:]
    if len(x) != a or len(y) != b or "-" in x or "-" in y:
        t=False
else:
    t=False
print("Yes" if t else "No")
Buggy code:
a, b = map(int, input().split())
s = input()

f = True
if s[a]!='-':
    f = False
if not s[:a].isnumeric() and s[a+1:].isnumeric():
    f = False
if f:
    print('Yes')
else:
    print('No')

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

f = True
if s[a]!='-':
    f = False
if not s[:a].isnumeric() and s[a+1:].isnumeric():
    f = False
if '-' in s[:a]+s[a+1:]:
    f = False
if f:
    print('Yes')
else:
    print('No')
Buggy code:
a,b=map(int,input().split())
s=input()
print(s)
if s[a]!="-":
    print("No")
    #print(1)
elif s.count("-")>1:
    print("No")
    #print(2)
else:
    s=s.replace("-","")
    #print(3)
    #print(s)
    if s.isdigit()==True:
        print("Yes")
    else:
        print("No")

Fixed code:

a,b=map(int,input().split())
s=input()
#print(s)
if s[a]!="-":
    print("No")
    #print(1)
elif s.count("-")>1:
    print("No")
    #print(2)
else:
    s=s.replace("-","")
    #print(3)
    #print(s)
    if s.isdigit()==True:
        print("Yes")
    else:
        print("No")
Buggy code:
a, b = map(int,input().split())
s = input()
s
print(('No','Yes')[len(s) == (a + b + 1) and s[a] == '-'])



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


Fixed 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()
Buggy code:
rule=[int(i) for i in input().split()]
nom=input()
if nom[rule[0]]=="-":
  if nom[rule[0]+1:].isdecimal() and nom[:rule[0]+1].isdecimal():
    print("Yes")
  else:
    print("No")
else:
  print("No")

Fixed code:
rule=[int(i) for i in input().split()]
nom=input()
if nom[rule[0]]=="-":
  if nom[rule[0]+1:].isdecimal() and nom[:rule[0]].isdecimal():
    print("Yes")
  else:
    print("No")
else:
  print("No")
Buggy 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)

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

ans = 'Yes'
if S[a + 1] == '-':
    S = S.replace('-', '', 1)
    for i in S:
        if not i in '1234567890':
            ans = 'No'
else:
    ans = 'No'
    
print(ans)

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

ans = 'Yes'
if S[a] == '-':
    S = S.replace('-', '', 1)
    for i in S:
        if not i in '1234567890':
            ans = 'No'
else:
    ans = 'No'
    
print(ans)
Buggy code:
import re
(A,B),S = map(int,input().split()),input()


if (len(S) == (A+B+1)) and (S[A] == '-') and (S.count('-') == 1) and len(re.findall('[0-9]', S)) == (A+B):
    print("yes")
else:
    print("No")


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


if (len(S) == (A+B+1)) and (S[A] == '-') and (S.count('-') == 1) and len(re.findall('[0-9]', S)) == (A+B):
    print("Yes")
else:
    print("No")
Buggy 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")

Fixed code:
def resolve():
    A, B = map(int, input().split())
    S = input()
    C = "1234567890"
    for i in range(A):
        if S[i] in C:
            continue
        else:
            print("No")
            exit()
    if S[A] != "-":
        print("No")
        exit()
    for i in range(A+1, len(S)):
        if S[i] in C:
            continue
        else:
            print("No")
            exit()
    print("Yes")
resolve()
Buggy 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")

Fixed code:
import sys
def no():
    print("No")
    sys.exit()

a,b=map(int,input().split())
s=input()
num=[str(i) for i in range(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")
Buggy code:
a, b = map(int, input().split())
s = input()
try:
  ac, bc = int(s[:a]), int(s[a + 1:])
  flag = True
except ValueError:
  flag = False
print('Yes' if flag else 'No')

Fixed code:
a, b = map(int, input().split())
s = input()
try:
  ac, bc = int(s[:a]), int(s[a + 1:])
  flag = True
except ValueError:
  flag = False
print('Yes' if flag and s[a] == '-' else 'No')
Buggy code:
#2019/10/24
AB, S = open(0).readlines()
# print(AB, S)
A, B = map(int, AB.split())
# print(A, B)
print('Yes' if S[:A].isdecimal() and S[A]=='-' and S[A+1:].isdecimal() else 'No')

Fixed code:
#2019/10/24
# AB, S = open(0).readlines()
# print(AB, S)
# A, B = map(int, AB.split())
# print(A, B)
A, B = map(int, input().split())
S = input()
print('Yes' if S[:A].isdecimal() and S[A]=='-' and S[A+1:].isdecimal() else 'No')
Buggy code:
a=list(map(int,input().split()))
S=input()
print(a[0])
if S.count("-") ==1 and S[a[0]]=="-":
	print("Yes")
else:
	print("No")


Fixed code:
a=list(map(int,input().split()))
S=input()
if S.count("-") ==1 and S[a[0]]=="-":
	print("Yes")
else:
	print("No")
Buggy code:
A,B=map(int,input().split())
S=input()
if (S[0:A].isdecimal()==True) and (S[A+1:-1].isdecimal()==True):
    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()
import sys
if len(s) != a + b + 1:
  print('No')
else:
  for i in range(a):
    if !(s[i].isdigit()):
      print('No')
      sys.exit(0)
  for i in range(b):
    if !(s[len(a)+i+1].isdigit()):
      print('No')
      sys.exit(0)
  if s[len(a)] != '-':
    print('No')
  else:
    print('Yes')

Fixed code:
a, b = map(int, input().split())
s = input()
import sys
if len(s) != a + b + 1:
  print('No')
else:
  for i in range(a):
    if s[i].isdigit() == False:
      print('No')
      sys.exit(0)
  for i in range(b):
    if s[a+i+1].isdigit() == False:
      print('No')
      sys.exit(0)
  if s[a] != '-':
    print('No')
  else:
    print('Yes')
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] == '-' \
    and s[:a].isdecimal() and s[a+1:].isdecimal():
    print('Yes')
else:
    print('No')
Buggy code:
a, b = map(int, input().split())
s = input()
if s[a] == "-" :
    try :
        if int(s[:a]) is int and int(s[a+1:]) is int :
            print("Yes")
    except :
            print("No")
else :
    print("No")

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


Fixed 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('\n'.join([input(), input()])))
Buggy code:
A, B = map(int,input().split())
S = list(input())
ans = True
if len(S) != (A+B+1):
    ans = False
elif S.count("-") != 1:
    ans = False
elif S.index("-") != A:
    ans = False
elif S != [i for i in S if i.isdecimal() or i == "-"]:
    ans = False
print(ans)


Fixed code:
A, B = map(int,input().split())
S = list(input())
ans = True
if len(S) != (A+B+1):
    ans = False
elif S.count("-") != 1:
    ans = False
elif S.index("-") != A:
    ans = False
elif S != [i for i in S if i.isdecimal() or i == "-"]:
    ans = False
if ans:
    print("Yes")
else:
    print("No")
Buggy 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")


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

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

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

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

flag=True
if S[A]!='-':
    flag=False
a=S[:A]
b=S[A+1:]
print(a)
print(b)
if not(a.isdigit() and b.isdigit()):
    flag=False
if flag:
    print('Yes')
else:
    print('No')


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

flag=True
if S[A]!='-':
    flag=False
a=S[:A]
b=S[A+1:]
if not(a.isdigit() and b.isdigit()):
    flag=False
if flag:
    print('Yes')
else:
    print('No')
Buggy code:
a, b = map(int, input().split())
s = input()

flag = 0

if s[a] == "-":
    if s[a:].isdecimal() and s[a+1:].isdecimal():
        flag = 1
    else:
        flag = 0


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

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

flag = 0


if s[a] == "-":
    if s[:a].isdecimal() and s[a+1:].isdecimal():
        flag = 1
    else:
        flag = 0


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

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

Fixed code:
A, B = list(map(int, input().split()))
S = input()
a = S[0:A]
x = S[A]
b = S[A + 1:]
if list(a).count("-") == 0 and x == "-" and list(b).count("-") == 0:
	print("Yes")
else:
	print("No")
Buggy code:
a,b = map(int,input().split())
n = input()
if n[a]=="-":
  if n[0:a-1].isdecimal() and n[a+1:b].isdecimal():
    print("Yes")
    exit()
print("No")

Fixed code:
a,b = map(int,input().split())
n = input()
if 1<=a<=5 and 1<=b<=5:
  if n[a]=="-":
    if n[0:a].isdecimal() and n[a+1:a+b+1].isdecimal():
      print("Yes")
      exit()
print("No")
Buggy code:
a,b = map(int,input().split())
s = list(input())
n = len(s)
ans = "No"
for i in range(n):
  if s[i] == "-":
    if a == i:
      ans = "Yes"
if s.count("-") >= 1:
  ans = "No"
      
print(ans)



Fixed code:
a,b = map(int,input().split())
s = list(input())
n = len(s)
ans = "No"
for i in range(n):
  if s[i] == "-":
    if a == i:
      ans = "Yes"
if s.count("-") > 1:
  ans = "No"
      
print(ans)
Buggy 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")
  

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

ng = 0
if not (s[0:A].isdecimal()):
  ng = 1
if s[A] != "-": ng = 1
if not (s[A+1:A+B+1].isdecimal()):
  ng = 1
if ng == 1:
  print("No")
else:
  print("Yes")
Buggy 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')

Fixed 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 not '-' in s[a + 1:]:
    flag2 = True

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

Fixed code:
def check(b):
    if not b:
        print('No')
        exit()
a, b = map(int, input().split())
s = input()
deg = '0123456789'
check(len(s) == a+b+1)
check(s[a] == '-')
for i in range(a+b+1):
    if i != a:
        check(s[i] in deg)
print('Yes')
Buggy code:
a,b = map(int,input().split())
s = input()
if len(s) == a + b + 1:
    if s[a] == "-":
        s = s.replace("-","")
        print(s)
        if s.isdecimal():
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

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

Fixed code:
import re
a,b=map(int,input().split())
s=input()
if re.search(r"^([0-9])*$",s[:a]) and s[a]=="-" and re.search(r"^([0-9])*$",s[a+1:]) and len(s)==a+b+1:
    print("Yes")
else:
    print("No")
Buggy 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")

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

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

S =  input()


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

print(ans)


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

S =  input()


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

print(ans)
Buggy 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')


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

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

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

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


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

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

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


Fixed 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)):
        if not '0' <= s[j] <= '9':
            return 'No'

    return 'Yes'


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

print(actual(a, b, s))
Buggy code:
A, B = [int(i) for i in input().split()]
S = list(input())
S[A] = '='

if '-' in S:
    print('No')
else:
    print('Yes')

Fixed code:
A, B = [int(i) for i in input().split()]
S = list(input())
if '-' in S:
    S[A] = '='
    if '-' in S:
        print('No')
    else:
        print('Yes')
else:
    print('No')
Buggy code:
a,b=map(int,input().split())
s=str(input())
slist=list(s)
temp=slist.count("-")
if temp==1 and slist[a]=="-":
  s.replace("","-")
  if s.isdecimal()==True:
    print("Yes")
  else:
    print("No")
else:
  print("No")


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

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

ans = ""
ss = ""
for i in range(len(s)):
    if i == a:
        ss += " "
    else:
        ss += s[i]    

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

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

Fixed code:
a, b = map(int, input().split())
s = input()
ans = 0
for i in range(len(s)):
    if s[i] == "-":
        if i == a and len(s)-i-1 == b:
            ans = 1
            for j in range(b):
                if s[-j] == "-":
                    ans = 0
                    break
            break
if ans == 0:
    print("No")
else:
    print("Yes")
Buggy code:
a, b = list(map(int, input().slpit()))
s = input().split('-')

if len(s) != 2:
    print('No')
elif len(s[0]) == a and len(s[1]) == b:
    print('Yes')
else:
    print('No')


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

if len(s) != 2:
    print('No')
elif len(s[0]) == a and len(s[1]) == b:
    print('Yes')
else:
    print('No')
Buggy code:
a,b = list(map(int,input().split(" ")))
s = input()
postal_code_len = a+b+1

num_list = list(map(str, range(0,10)))

flag = True
print([c in num_list for c in list(s[:a]+s[a+1:]) ])
if s[a] == "-" and all([ c in num_list for c in list(s[:a]+s[a+1:]) ]):
    print("Yes")
else:
    print("No")

Fixed code:
a,b = list(map(int,input().split(" ")))
s = input()
postal_code_len = a+b+1

num_list = list(map(str, range(0,10)))

flag = True
#print([c in num_list for c in list(s[:a]+s[a+1:]) ])
if s[a] == "-" and all([ c in num_list for c in list(s[:a]+s[a+1:]) ]):
    print("Yes")
else:
    print("No")
Buggy 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")

Fixed 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")
Buggy 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")

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

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

Fixed code:
A, B = map(int,input().split())
S = input()
if(S[A] == '-'):
  if(S[:A].isdigit() and S[A+1:A+B+1].isdigit()):
    print('Yes')
  else:
    print('No')
else:
  print('No')
Buggy code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
e = 0
for i in c:
    if i !="-" and i !=i:
        e += 1
if a+b+1 == d and c[a] =="-" and e==d:
    print("Yes")
else:
    print("No")

Fixed code:
#B Postal Code
a , b = map(int,input().split())
c = input()
d = len(c)
e = 0
for i in range(d):
    if c[i] =="-" and i != a:
        e = e + 1
if a+b+1 == d and c[a] =="-" and e == 0:
    
    print("Yes")
else:
    print("No")
Buggy code:
a,b = map(int,input().split())
s = input()

lst = s.split("-")
#print(lst)
if len(lst[0]) == a and len(lst[1]) == b and len(lst) == 2:
    print("Yes")
else:
    print("no")

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

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

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