import std.stdio, std.array, std.conv, std.string, std.range, std.algorithm;


void main() {
    long a, b, c;
    readf("%d %d %d", &a, &b, &c);

    if ((a <= c && c <= b) || (b <= c && c <= a)) {
        writeln("Yes");
    } else {
        writeln("No");
    }

}
