There are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.
Constraints
0\leq A,B,C\leq 100
A, B and C are distinct integers.
Input
Input is given from Standard Input in the following format:
A B C
Output
Print Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.
Examples
Input
3 8 5
Output
Yes
Input
7 3 1
Output
No
Input
10 2 4
Output
Yes
Input
31 41 59
Output
No
Assistant
We need to interpret problem: There are three houses on number line at coordinates A (house1), B (house2), C (house3). Print "Yes" if we pass the coordinate of house3 on the straight way from house1 to house2 without making a detour. Essentially, when traveling directly from A to B along the number line (a straight line, since it's a number line), do we necessarily pass through point C? That is, is C between A and B inclusive? But note "without making a detour" suggests that the path from A to B goes straight, so it passes through all points between A and B. If C lies between A and B, then we will pass it. If C lies outside the interval, then we would have to go out of the way (detour) to visit C. So answer is Yes if C is between A and B, else No.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
But careful: The problem statement says "on the straight way from House 1 to House 2 without making a detour". Could also be interpreted as: we are going from House 1 to House 2, and we want to know if we will pass House 3 along that straight path. That indeed means C is between A and B. However, we need to consider direction? No, the path from A to B includes all points from min(A,B) to max(A,B). So condition: (A < C < B) or (B < C < A). But since they are distinct integers, we can just check if C is between them. In Python: (A < C < B) or (B < C < A) simplifies to min(A, B) < C < max(A, B). But careful: if C equals one endpoint? They are distinct, so C cannot equal A or B. So just between.
Check examples:
3 8 5 -> min=3, max=8, C=5 is between => Yes.
7 3 1 -> min=3, max=7, C=1 is less than 3 => No.
10 2 4 -> min=2, max=10, C=4 is between => Yes.
31 41 59 -> min=31, max=41? Actually 31 and 41: min=31, max=41, C=59 >41 => No. Output No, matches.
So solution is straightforward.
Constraints small, but we can handle anyway.
Implementation: read three ints, check if min(A,B) < C < max(A,B), print "Yes" else "No".
Edge cases: none.
Thus solution.
But maybe there is nuance: The phrase "without making a detour" could also imply that we consider the path from house1 to house2 directly, but we might need to pass house3 along that straight path either direction. Same.
Thus answer. ```python
def main():
import sys
A, B, C = map(int, sys.stdin.read().split())
if min(A, B) < C < max(A, B):
print("Yes")
else:
print("No")