Three people, A, B and C, are trying to communicate using transceivers. They are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively. Two people can directly communicate when the distance between them is at most d meters. Determine if A and C can communicate, either directly or indirectly. Here, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.
S = input("4つの値をスペースで区切って入力してね：")
data_list = S.split()
ab_distance = abs(int(data_list[0])-int(data_list[1]))
ac_distance = abs(int(data_list[0])-int(data_list[2]))
bc_distance = abs(int(data_list[1])-int(data_list[2]))
d = int(data_list[3])
if ac_distance <= d:
    print('Yes')
elif ab_distance <= d and bc_distance <= d:
    print('Yes')
else:
    print('No')
S = input()
data_list = S.split()
ab_distance = abs(int(data_list[0])-int(data_list[1]))
ac_distance = abs(int(data_list[0])-int(data_list[2]))
bc_distance = abs(int(data_list[1])-int(data_list[2]))
d = int(data_list[3])
if ac_distance <= d:
    print('Yes')
elif ab_distance <= d and bc_distance <= d:
    print('Yes')
else:
    print('No')