qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a, b, c, d = map(int, input().split())

AB = abs(a-b)
BC = abs(b-c)
AC = abs(a-c)

if AB <= d and BC <= d:
    print('Yes')
elif AC <= d:
    print('Yse')
else:
    print('No')

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

AB = abs(a-b)
BC = abs(b-c)
AC = abs(a-c)

if AB <= d and BC <= d:
    print('Yes')
elif AC <= d:
    print('Yes')
else:
    print('No')
Buggy code:
def main():
    a, b, c, d = map(int, input().split())
    distance = [a, b, c]
    distance.sort()
    if distance[2] - distance[1] <= d and distance[1] - distance[0] <= d:
        print('Yes')
    else:
        print('No')
main()

Fixed code:
def main():
    a, b, c, d = map(int, input().split())
    distance = [a, b, c]
    a_c_distance = [a, c]
    a_c_distance.sort()
    if a_c_distance[1] - a_c_distance[0] <= d:
        print('Yes')
        return
    distance.sort()
    if distance[2] - distance[1] <= d and distance[1] - distance[0] <= d:
        print('Yes')
    else:
        print('No')
    
main()
Buggy code:
a, b, c, d = map(int, input())
print('Yes' if abs(a-c) <= d or max(abs(a-b), abs(b-c)) <= d else 'No')

Fixed code:
a, b, c, d = map(int, input().split())
print('Yes' if abs(a-c) <= d or max(abs(a-b), abs(b-c)) <= d else 'No')
Buggy code:
a, b, c, d = map(int, input().split())
if abs(b - a) <= d and abs(c - b) <= d:
  print('Yes')
else:
  print('No')


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

print('Yes' if abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d) else 'No')
Buggy code:
def AreCloseEnough(x,y,d):
    if x-y <= d or x-y >= -d:
        return True
    return False

def main():
    a,b,c,d = map(int, input().strip().split())
    if AreCloseEnough(a,c,d):
        print("Yes")
    elif AreCloseEnough(a,b) and AreCloseEnough(b,c):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Fixed code:
def AreCloseEnough(x,y,d):
    if x-y <= d and x-y >= -d:
        return True
    return False

def main():
    a,b,c,d = map(int, input().strip().split())
    if AreCloseEnough(a,c,d):
        print("Yes")
        return
    if AreCloseEnough(a,b,d) and AreCloseEnough(b,c,d):
        print("Yes")
        return
    print("No")
    return

if __name__ == "__main__":
    main()
Buggy code:
a, b, c, d = map(int, input().split())
if b - a <= d and c - b <= d:
  print('Yes')
else:
  print('No')

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

if ((a<=b) and (b<=c)) or ((c<=b) and (b<=a)):
  if (abs(a-b)<=d) and (abs(b-c)<=d):
    print("Yes")
  else:
    print("No")
else:
  if abs(a-c)<=d:
    print("Yes")
  else:
    print("No")
Buggy code:
a,b,c,d=map(int,input().split())
if b-a<=d and c-b<=d:
    print("Yes")
else:print("No")


Fixed code:
a,b,c,d = map(int, input().split(" "))

if abs(a-c)<=d:
  print("Yes")
elif abs(a-b)<=d and abs(b-c)<=d:
  print("Yes")
else:
  print("No")
Buggy code:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print("Yes")
elif abs(a-b)<=d & abs(b-c)<=d:
  print("Yes")
else:
  print("No")

Fixed code:
a,b,c,d=map(int,input().split())
if ((abs(a-c)<=d) | ((abs(a-b)<=d) & (abs(b-c)<=d))):
  print("Yes")
else:
  print("No")
Buggy code:
a, b, c, d = map(int, input().split())
if abs(a, b) <= d and abs(b, c) <= c:
  print("Yes")
else:
  print("No")

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

if abs(a-b) <= d and abs(b-c) <= d:
  print('Yes')
elif abs(a-c) <= d:
  print('Yes')
else:
  print('No')
Buggy code:
a, b, c, d = map(int, input().split())
if abs(a - b) <= d and abs(b - c) <= d:
  print("Yes")
else:
  print("No")

Fixed code:
a, b, c, d = list(map(int, input().split()))


if abs(b - a) <= d and abs(c - b) <= d or abs(c - a) <= d:
    print('Yes')
else:
    print('No')
Buggy code:
a,b,c,d = map(int,input().split())
if abs(a-c) < d or (abs(a-b) < d and abs(b-c) < d):
    print('Yes')
else:
    print('No')

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

print('Yes' if abs(c-a) <= d or (abs(b-a) <= d and abs(b-c) <= d) else 'No')
Buggy code:
a, b, c, d = map(int, input().split())
if abs(a-b)<=d:
    print('Yes')
elif not ((a<=c<=b)or(b<=c<=a)):
    print('No')
else:
    if (abs(a-c)<=d)and(abs(b-c)<=d):
        print('Yes')
    else:
        print('No')

Fixed code:
(a, b, c, d) = map(int, input().split(" "))

if (abs(a-b) <= d and abs(b-c) <= d) or (abs(a-c) <= d):
    print("Yes")
else:
    print("No")
Buggy code:
A,B,C,D=map(int,input().split(' '))
if abs(A-C) <= D or ((abs(B-A)) <= D and abs(B-D)<=D):
    print('Yes')
else:
    print('No')

Fixed code:
A,B,C,D=map(int,input().split(' '))
if abs(A-C) <= D or ((abs(B-A)) <= D and abs(B-C)<=D):
    print('Yes')
else:
    print('No')
Buggy code:
a,b,c,d= map(int,input().split())
if abs(c-a)<=d:print('Yes')
else:print('No')

Fixed code:
a, b, c, d = map(int, input().split())
if(abs(c - a) <= d or (abs(b - a) <= d and abs(c - b) <= d)):
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c,d = map(int,input().split())
if (abs(a-b)<d)&(abs(b-c)<d):
    print("Yes")
elif (abs(a-c)<d):
    print("Yes")
else:
    print("No")

Fixed code:
a,b,c,d = map(int,input().split())
if (abs(b-a)<=d)&(abs(c-b)<=d):
    print("Yes")
elif (abs(c-a)<=d):
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c,d=map(int,raw_input().split())
if(abs(a-b)<=d and abs(b-c)<=d): print("Yes")
else: print("No")

Fixed code:
a, b, c, d = map(int, input().split())
if abs(a-b) <abs(a-c):
  if abs(a-b)<=d and abs(b-c)<=d:
    print('Yes')
  else:
    print('No')
else:
  if abs(a-c)<= d:
    print('Yes')
  else:
    print('No')
Buggy code:
a,b,c,d=map(int,input().split())
if abs(a-b)<=d and (abs(a-c)<=d or abs(b-c)<=d):
    print('Yes')
else:
    print('No')


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

if(abs(a-c)<=d):
    print("Yes")
elif(abs(a-b)<=d and abs(b-c)<=d):
    print("Yes")
else:
    print("No")
Buggy code:
A, B, C, D = map(int, input().split())
ABC = [A,B,C]
if abs(ABC[0] - ABC[2]) <= D:
    print('Yes')
    exit(0)
for i in range(1,3):
    if ABC[i] - ABC[i-1] <= D:
        continue
    else:
        print('No')
        exit(0)
print('Yes')



Fixed code:
A, B, C, D = map(int, input().split())
ABC = [A,B,C]
if abs(ABC[0] - ABC[2]) <= D:
    print('Yes')
    exit(0)
for i in range(1,3):
    if abs(ABC[i] - ABC[i-1]) <= D:
        continue
    else:
        print('No')
        exit(0)
print('Yes')
Buggy code:
n = list(map(int,input().split()))
if ((n[3] > abs(n[0]-n[1])) and( n[3] > abs(n[1]-n[2]))) or( n[3] > abs(n[0]-n[2])):
    print('Yes')
else:
    print('No')

Fixed code:
n = list(map(int,input().split()))
if ((n[3] >= abs(n[0]-n[1])) and( n[3] >= abs(n[1]-n[2]))) or( n[3] >= abs(n[0]-n[2])):
    print('Yes')
else:
    print('No')
Buggy code:
a,b,c,d=[int(i) for i in input().split()]
if abs(a-b)<=d and abs(b-c) <=d:
  print("Yes")
else:
  print("No")

Fixed code:
a,b,c,d=[int(i) for i in input().split()]
if (abs(a-b)<=d and abs(b-c) <=d) or(abs(a-c)<=d):
  print("Yes")
else:
  print("No")
Buggy code:
a, b, c, d = map(int, input().split())

if a - d <= c <= a + d:
  print("Yes"):
elif a - d <= b <= a + d and c - d <= b <= c + d:
  print("Yes")
else:
  print("No")
  

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

if a - d <= c <= a + d:
  print("Yes")
elif a - d <= b <= a + d and c - d <= b <= c + d:
  print("Yes")
else:
  print("No")
Buggy code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    a, b, c, d = map(int, input().split())
    if abs(a - b) <= d and abs(b - c) <= d: print("Yes")
    else: print("No")

if __name__ == "__main__":
    main()


Fixed code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    a, b, c, d = map(int, input().split())
    if abs(a - b) <= d and abs(b - c) <= d: print("Yes")
    elif abs(a - c) <= d: print("Yes")
    else: print("No")

if __name__ == "__main__":
    main()
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    A, B, C, D = map(int, input().split())
    print('Yes'if abs(A - B) <= D and abs(B - C) < D else 'No')


if __name__ == "__main__":
    main()


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


def main():
    A, B, C, D = map(int, input().split())
    print('Yes'if (	abs(A - B) <= D and abs(B - C) <= D)
          or abs(A - C) <= D else 'No')


if __name__ == "__main__":
    main()
Buggy code:
a, b,c, d = list(map(int, input().split()))

if (abs(a-b)<=d) and (abs(b-c)<=d):
    print("Yes")
else:
    print("No")

Fixed code:
a,b,c,d=map(int,input().split())
if abs(b-a)<=d and abs(c-b)<=d or abs(c-a)<=d:
	print('Yes')
else: print('No')
Buggy code:
a, b, c, d = map(int, input().spit())
ans = "No"
if abs(c-a) <= d:
  ans = "Yes"
elif abs(b-a) <= d and abs(c-b) <= d:
  ans = "Yes"
print(ans) 

Fixed code:
a, b, c, d = map(int, input().split())
ans = "No"
if abs(c-a) <= d:
  ans = "Yes"
elif abs(b-a) <= d and abs(c-b) <= d:
  ans = "Yes"
print(ans)
Buggy code:
a,b,c,d=map(int,input().split())
if(c>a and c-a<=d):
 print("Yes\n")
elif(a>c and a-c<=d):
 print("Yes\n")
elif(c>a and c-b<=d and b-a<=d):
 print("Yes\n")
elif(a>c and a-b<=d and b-c<=d):
 print("Yes\n")
else:
 print("No\n")


Fixed code:
a,b,c,d=map(int,input().split())
if(c>a and c-a<=d):
 print("Yes\n")
elif(a>=c and a-c<=d):
 print("Yes\n")
elif(c>a and c-b<=d and b-a<=d):
 print("Yes\n")
elif(a>c and a-b<=d and b-c<=d):
 print("Yes\n")
else:
 print("No\n")
Buggy code:
a , b, c , d = map(int,input().split())
if abs(a - b ) <= d and abs(b - c) <= d :
  print('Yes')
elif abs(a -c) > d:
  print('Yes')
else:
  print('No')


Fixed code:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
    print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
    print("Yes")
else:
    print("No")
Buggy code:
a = list(map(int,input().split()))
d = abs(a[0] - a[2])
d1 = abs(a[0] - a[1])
d2 = abs(a[1] - a[2])
if d <= a[3]:
  print("Yes")
elif d1 <= a[3] or d2 <= a[3]:
  print("Yes")
elif a[0] = a[1] and a[0] = a[2]:
  print("Yes")
else: print("No")

Fixed code:
a = list(map(int,input().split()))
d = abs(a[0] - a[2])
d1 = abs(a[0] - a[1])
d2 = abs(a[1] - a[2])

if d <= a[3]:
  print("Yes")
elif d1 <= a[3] and d2 <= a[3]:
  print("Yes")
else: print("No")
Buggy code:
a,b,c,d = map(int, input().split())

if abs(a - b) <= d and abs(b - c) <= d:
    print('Yes')
else:
    print('No')

Fixed code:
a, b, c, d = map(int, input().split())
if abs(c - a) <= d or (abs(c - b) <=d and abs(b - a) <= d):
    print('Yes')
else:
    print('No')
Buggy code:
a, b, c, d = map(int, input().split())
if abs(c - a) >= d:
  print("Yes")
elif abs(b - a) >= d and (c - b) >= d:
  print("Yes")
else:
  print("No")

Fixed code:
a, b, c, d = map(int, input().split(" "))

if abs(a-c) <= d:
    print("Yes")
elif abs(a-b) <= d and abs(c-b) <= d:
    print("Yes")
else:
    print("No")
Buggy code:
a, b, c, d = map(int, input().split())
if abs(c-b)<=d and abs(b-a)<=d:
    print('Yes')
else:
    print('No')

Fixed code:
a,b,c,d = list(map(int,input().split()))
if abs(a-c)<=d:
    print("Yes")
elif abs(a-b)<=d and abs(b-c)<=d:
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c,x=map(int,input().split())
if abs(a-c)<=x:
  print("Yes")
elif abs(a-b)<=x and abs(a-c)<=x:
  print("Yes")
else:
  print("No")

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

if abs(a-c)<=d:
    print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
    print("Yes")
else:
    print('No')
Buggy code:
a,b,c,d = map(int,input().split())

if abs(a-b)<=d or abs(b-c)<=d:
    print("Yes")
else:
    print('No')


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

if(abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d)):
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
  print('Yes')
else:
  print('No')


Fixed code:
a,b,c,d = map(int,input().split())
judge = 0

if((abs(b-a)<=d)and(abs(c-b)<=d)):
   print('Yes')
elif(abs(c-a)<=d):
   print('Yes')
else:
   print('No')
Buggy code:
a, b, c, d = map(int, input().split())
ans = 0
if abs(a-c) <= d: 
    ans = 1
if abs(a-b) <= d && abs(b-c) <= d: 
    ans = 1
if ans == 1:
    print("Yes")
else
	print("No")

Fixed code:
a, b, c, d = map(int, input().split())
ans = 0
if abs(a-c) <= d: 
    ans = 1
if abs(a-b) <= d and abs(b-c) <= d: 
    ans = 1
if ans == 1:
    print("Yes")
else:
	print("No")
Buggy code:
import sys


xs = list(sys.stdin.readline().split(' '))
a,b,c,d = [int(x) for x in xs]

f = (lambda x,y: abs(max(x,y) - min(x,y)) <= d)
g = (lambda x,y,z: f(x,y) or f(x,z) and f(y,z))

if g(a,b, c) and g(b,c, a) and g(c,a, b):
	print("Yes")
else:
	print("No")


Fixed code:
import sys


xs = list(sys.stdin.readline().split(' '))
a,b,c,d = [int(x) for x in xs]

f = (lambda x,y: abs(x - y) <= d)
g = (lambda x,y,z: f(x,y) or (f(x,z) and f(y,z)))

if g(a,c, b):
	print("Yes")
else:
	print("No")
Buggy code:
a,b,c=map(int,input().split())
if abs(a-b)<=d or abs(a-c)<=d:
  print('Yes')
else:
  print('No')

Fixed code:
a, b, c, d = map(int, input().split())
print("Yes" if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d) else "No")
Buggy code:
a, b, c, d = map(int, input().split())
if abs(a - c) <= d or abs(a - b) + abs(b - c) <= d:
	print('Yes')
else:
	print('No')

Fixed code:
a,b,c,d=map(int, input().split())
if abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d): print('Yes')
else: print('No')
Buggy code:
a, b, c, d = map(int, input()split())
if abs(a - c) <= d:
	print('Yes')
else:
	if abs(a - b) <= d and abs(c - b) <= d:
		print('Yes')
	else:
		print('No')

Fixed code:
a, b, c, d = list(map(int, input().split()))

if abs(a - c) <= d:
    print("Yes")
else:
    if a <= b and b <= c:
        if abs(a - b) <= d and abs(b - c) <= d:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
Buggy code:
a,b,c,d=map(int, input().split())
if c>=a and c-a<=d:
 print('Yes')
elif c<a and a-c<=d:
 print('Yes')
else:
 print('No')


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

if abs(c-a)<=d:
  print('Yes')
elif abs(b-a)<=d and abs(c-b)<=d:
  print('Yes')
else:
  print('No')
Buggy code:
a,b,c,d=map(int, input().split())
if c-a<=d:
 print('Yes')
else:
 print('No')

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

if abs(b-a) <= d and abs(c-b) <= d:
  print("Yes")
else:
  if abs(a-c) <= d:
    print("Yes")
  else:
    print("No")
Buggy code:

a, b, c, d = map(int, input().split())
print("Yes" if (abs(b - a) <= d and abs(c - b) <= d) or abs(c - a <= d)  else "No")

Fixed code:
a,b,c,d = list(map(int,input().split()))
if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d):
    print("Yes")
else:
    print("No")
Buggy code:

a, b, c, d = map(int, input().split())
print("Yes" if abs(b - a) <= d and abs(c - b) <= d else "No")

Fixed code:
a, b, c, d = map(int, input().split(" "))
if (abs(a-b) <= d and abs(b-c) <= d) or abs(a-c) <= d:
  print("Yes")
else:
  print("No")
Buggy code:
lst=list(map(int,input().split()))


if abs(lst[0]-lst[2])<=lst[3] or (abs(lst[0]-lst[1])<=lst[3] and abs(lst[2]-lst[1])<=lst[3]:
    print("Yes")
else:
    print("No")

Fixed code:
lst=list(map(int,input().split()))


if abs(lst[0]-lst[2])<=lst[3] or (abs(lst[0]-lst[1])<=lst[3] and abs(lst[2]-lst[1])<=lst[3]):
    print("Yes")
else:
    print("No")
Buggy code:
def main():
    a,b,c,d = map(int, input().split())

    if abs(a-c)<=d or abs(abs(a-b)+abs(b-c)):
        print('Yes')
        return
    print('No')


if __name__ == '__main__':
    main()


Fixed code:
def main():
    a,b,c,d = map(int, input().split())

    if abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d):
        print('Yes')
        return
    print('No')


if __name__ == '__main__':
    main()
Buggy code:
a, b, c, d = map(int, input().split())

if (min(abs(a-b)) <= d and min(abs(b-c)) <= d) or min(abs(a-c)) <= d:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

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

if (abs(a-b) <= d and abs(b-c) <= d) or abs(a-c) <= d:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
Buggy code:
a, b, c, d = (int(i) for i in input().split())

if abs(a-c) < d or (abs(a-b)<d and abs(b-c<d)):
    print("Yes")
else:
    print("No")

Fixed code:
a, b, c, d = (int(i) for i in input().split())

if abs(a-c) <= d or (abs(a-b)<=d and abs(b-c)<=d):
    print("Yes")
else:
    print("No")
Buggy code:
import math
line = input()
line1 = line.split(" ")

#for i in line1:
  #  line1[i] = int(i)

adis = line1[0]
bdis = line1[1]
cdis = line1[2]
count = line1[3]

AB = abs(int(bdis) - int(adis))
BC = abs(int(cdis) - int(bdis))
#AB = abs(AB)


if int(AB) <= int(count) and int(BC) <= int(count):
    print("Yes")
else:
    print("No")

Fixed code:
import math
line = input()
line1 = line.split(" ")

#for i in line1:
  #  line1[i] = int(i)

adis = line1[0]
bdis = line1[1]
cdis = line1[2]
count = line1[3]

AB = abs(abs(int(bdis)) - abs(int(adis)))
BC = abs(abs(int(cdis)) - abs(int(bdis)))
#AB = abs(AB)


if int(AB) <= int(count) and int(BC) <= int(count):
    print("Yes")
elif abs(abs(int(cdis)) - abs(int(adis))) <= int(count):
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c,d = map(int,input().split())
if abs(a-b)<=d and abs(c-b)<=d:
    print('Yes')
else:
    print('No')

Fixed code:
a,b,c,d = list(map(int,input().split()))
if abs(c-a)<=d:
    print ("Yes")
elif abs(c-b)<=d and abs(b-a)<=d:
    print ("Yes")
else:
    print ("No")
Buggy code:
ls = list(map(lambda x: int(x), input().split()))
if abs(ls[0] - ls[1]) <= ls[3] and abs(ls[0] - ls[2]) <= ls[3] and abs(ls[1] - ls[2]) <= ls[3]:
    print("Yes")
else:
    print("No")


Fixed code:
ls = list(map(lambda x: int(x), input().split()))
if abs(ls[0] - ls[2]) <= ls[3] or (abs(ls[0] - ls[1]) <= ls[3] and abs(ls[1] - ls[2]) <= ls[3]):
    print("Yes")
else:
    print("No")
Buggy code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

a,b,c,d=I()
if abs(a-b)<=d and abs(b-c)==d:
    print("Yes")
else:
    print("No")


Fixed code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

a,b,c,d=I()
if (abs(a-b)<=d and abs(b-c)<=d) or abs(a-c) <= d:
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c,d=map(int,input(),split())
print('NYoe s'[abs(a-c)<=d or (abs(b-a)<=d and abs(c-b)<=d)::2])

Fixed code:
a,b,c,d=map(int,input().split())
print('NYoe s'[abs(a-c)<=d or (abs(b-a)<=d and abs(c-b)<=d)::2])
Buggy code:
arr = input().split()
arr = list(map(int,arr))
a = arr[0]
b = arr[1]
c = arr[2]
d = arr[3]


if b - a <= d and c - b <= d:
    print('Yes')
else:
    print('No')


Fixed code:
arr = input().split()
arr = list(map(int,arr))
a = arr[0]
b = arr[1]
c = arr[2]
d = arr[3]


if (abs(b - a) <= d and abs(c - b) <= d) or abs(a-c) <= d:
    print('Yes')
else:
    print('No')
Buggy code:
import math

a, b, c, d = list(map(int, input()))

if math.fabs(a - c) <= d:
  print("Yes")
elif math.fabs(a - b) <= d and math.fabs(b - c) <= d:
  print("Yes")
else:
  print("No")


Fixed code:
import math

a, b, c, d = list(map(int, input().split()))

if math.fabs(a - c) <= d:
  print("Yes")
elif math.fabs(a - b) <= d and math.fabs(b - c) <= d:
  print("Yes")
else:
  print("No")
Buggy code:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or abs(a-b)<=d=>abs(b-c):print("Yes")
else:print("No")

Fixed code:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or (abs(a-b)<=d and d>=abs(b-c)):print("Yes")
else:print("No")
Buggy code:
a, b, c, d = map(int, input().split())

if abs(a-b)<=d and abs(b-c)<=d:
    print("Yes")
else:
    print("No")
    

Fixed code:
a, b, c, d = map(int, input().split())
if -d <= a - c <= d:
    print("Yes")
elif -d <= a-b <= d and -d <= b - c <= d:
    print("Yes")
else:
    print("No")
Buggy code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c,d = iim()

if abs(a-c) < d or (abs(a-b) < d and abs(b-c) < d):
    print('Yes')
else:
    print('No')

Fixed code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c,d = iim()

if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d):
    print('Yes')
else:
    print('No')
Buggy code:
a,b,c,d=map(int,input().split())
if abs(a-b)<=d:
  if abs(b-c)<=d:
    print('Yes')
else:
  print('No')


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

if abs(a-c) <=d:
  print("Yes")
elif (abs(a-b) <= d) & (abs(b-c) <= d):
  print("Yes")
else:
  print("No")
Buggy code:
a,b,c,d=map(int,input().split())

if (b-a<=d and c-b<=d) or c-a<=d:
	print('Yes')
else:
	print('No')

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

if (abs(b-a)<=d and abs(c-b)<=d) or abs(c-a)<=d:
	print('Yes')
else:
	print('No')
Buggy code:
a, b, c, d = map(int, input().split())

dist1 = abs(a - b)
dist2 = abs(b - c)

if dist1 <= d and dist2 <= d:
    print('Yes')
else:
    print('No')
    

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

dist1 = abs(a - b)
dist2 = abs(b - c)

if dist1 <= d and dist2 <= d or abs(a - c) <= d:
    print('Yes')
else:
    print('No')
Buggy code:
a,b,c,d=(int(i) for i in input().split())

if abs(a-c) =< d or (abs(a-b) =< d and abs(b-c) =< d) :
    print("Yes")
else:
    print("No")

Fixed code:
a,b,c,d=(int(i) for i in input().split())

if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d) :
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c,d=map(int,input().split())
if abs(c-a)>d:
	if abs(b-a)>d:
		if abs(c-b)>d:
			print("Yes")
		else:
			print("No")
	else:
		print("No")
else:
	print("Yes")

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

if d >= abs(a - c):
    print('Yes')
elif d >= abs(b - a) and d >= abs(b - c):
    print('Yes')
else:
    print('No')
Buggy code:
a,b,c,d=map(int,input().split())
if abs(a-b)<=d and abs(b-c)<=d:
  print('Yes')
else:
  print('No')

Fixed code:

a, b, c, d = map(int, input().split())

if abs(c-a) <= d:
    print('Yes')

elif abs(b-a) <= d and abs(c-b) <= d:
    print('Yes')

else:
    print('No')
Buggy code:
A, B, C, d = map(int, input().split())
if B-A <= d and C-B <= d:
    print("Yes")
elif C-A <= d:
    print("Yes")
else:
    print("No")


Fixed code:
A, B, C, d = map(int, input().split())
if abs(B-A) <= d and abs(C-B) <= d:
    print("Yes")
elif abs(C-A) <= d:
    print("Yes")
else:
    print("No")
Buggy code:
import math
a,b,c,d = map(int,input().split())
if math.fabs(b-a)<=d and math.fabs(c-b)<=d:
    print("Yes")
else:
    print("No")


Fixed code:
import math
a,b,c,d = map(int,input().split())
if math.fabs(b-a)<=d and math.fabs(c-b)<=d:
    print("Yes")
elif math.fabs(c-a)<=d:
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c,d=map(int,input().split())
print('Yes' if abs(a-d)<=d and abs(b-c)<=d else 'No')

Fixed code:
a,b,c,d=map(int,input().split())
print('Yes' if abs(a-c)<=d or abs(a-b)<=d and abs(b-c)<=d else 'No')
Buggy code:
a, b, c, d = [ int(v) for v in input().split() ]
if abs(a-b) <= d and abs(c-b) <= d:
  print("Yes")
else:
  print("No")

Fixed code:
a, b, c, d = [ int(v) for v in input().split() ]
if abs(a-b) <= d and abs(c-b) <= d:
  print("Yes")
elif abs(a-c) <= d:
  print("Yes")
else:
  print("No")
Buggy code:
a,b,c,d=map(int,input().split())
if ((abs(a-b)<=d)+(abs(b-c)<=d)+(abs(a-c)<=d))>1:print("Yes")
else:print("No")

Fixed code:
a,b,c,d=map(int,input().split())
if (abs(a-b)<=d)+(abs(b-c)<=d)>1:print("Yes")
elif abs(a-c)<=d:print("Yes")
else:print("No")