import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

bool calc(int a, int b, int c) {
    return min(a, b) < c && c < max(a, b);
}

void main() {
    auto abc = readints;
    int a = abc[0];
    int b = abc[1];
    int c = abc[2];
    writeln(calc(a, b, c) ? "Yes" : "No");
}
