import std.stdio;
import std.conv;
import std.array;

void main()
{
    auto reader = readln.split;
    int A = reader[0].to!int;
    int B = reader[1].to!int;
    int C = reader[2].to!int;

    if ((A < C && C < B) || (A > C && C > B)) writeln("Yes");
    else writeln("No");
}

