diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -1,5 +1,5 @@
 N, X, Y, Z = map(int, input().split())
-if (X < Y and Y < Z) or (X > Y and Y > Z):
+if (X < Z and Z < Y) or (X > Z and Z > Y):
     print("Yes")
 else:
     print("No")
