#include<cstdio>
using namespace std;
int n,i,la,nw,fl,tp;
int main(){
for(scanf("%d%d",&n,&la);++i<n;la=nw,fl=tp)
if(scanf("%d",&nw),fl>(tp=(nw>la?0:(nw<la?2:1))))return puts("NO");
return puts("YES");
}
#include<cstdio>
int main()
{
int a,b,c,i,ans=0;
scanf("%d%d%d",&a,&b,&c);
for(scanf("%d",&i);i--;)scanf("%d",&a),a>b&&a<c?++ans:0;
printf("%d",ans);
}