#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define LD long double
#define UG unsigned
int x1,y1,x2,y2;
bool opt1()
{
return x1==x2||y1==y2;
}
bool opt2()
{
return false;
}
bool opt3()
{
int dx[8]={2,2,-2,-2,1,1,-1,-1};
int dy[8]={1,-1,1,-1,2,-2,2,-2};
for(int k=0;k<8;k++)
{
int tx=x1+dx[k];
int ty=y1+dy[k];
if(tx==x2&&ty==y2) return true;
}
return false;
}
bool opt4()
{
int dx[4]={2,2,-2,-2};
int dy[4]={2,-2,2,-2};
for(int k=0;k<4;k++)
{
int tx=x1+dx[k];
int ty=y1+dy[k];
if(tx==x2&&ty==y2) return true;
}
return false;
}
signed main()
{
int op;
cin>>op>>x1>>y1>>x2>>y2;
if(op==1)
{
if(opt1()) puts("Yes");
else puts("No");
}
else if(op==2)
{
if(opt2()) puts("Yes");
else puts("No");
}
else if(op==3)
{
if(opt3()) puts("Yes");
else puts("No");
}
else
{
if(opt4()) puts("Yes");
else puts("No");
}
return 0;
}