import std;
enum inf(T)()if(__traits(isArithmetic,T)){return T.max/4;}
T scan(T=long)(){return readln.chomp.to!T;}
void scan(T...)(ref T args){auto input=readln.chomp.split;foreach(i,t;T)args[i]=input[i].to!t;}
T[] scanarr(T=long)(){return readln.chomp.split.to!(T[]);}
//END OF TEMPLATE

void main(){
    ulong n;
    ulong m;
    scan(n,m);
        
    auto h=scanarr!ulong;
    ulong[][] j;
    j.length=n;
    n.iota.each!(i=>j[i].length=n);

    ulong a,b;
    foreach(i;0..m){
        scan(a,b);
        j[a-1]~=
            h[b-1];
        j[b-1]~=
            h[a-1];
    }   

    ulong ans;
    foreach(i;0..n){
        if(j[i].filter!(hi=>h[i]<=hi).array.length==0)
            ans++;
    }
    ans.writeln;
}
