function Main (input) {
    const houses = input.split(' ');
    if((houses[2] - houses[0]) * (houses[1] - houses[2]) >= 0) {
        console.log('Yes');
    } else {
        console.log('No');
    }
}

Main(require('fs').readFileSync('/dev/stdin', 'utf-8'));