

void main(){
	
	auto NM = readLine!size_t();
	
	auto H = readLine!size_t();

	long[][] t;
	
	t = new long[][](H.length,H.length);
	
	
	foreach( i ; 0..NM[1] ){
		auto AB = readLine!size_t();
		AB[0]-=1;AB[1]-=1;
		t[AB[0]][AB[1]] = t[AB[1]][AB[0]] = 1;
	}
	
	
	ulong sum;
	OuterLoop:foreach( key1 , arr1 ; t[] ){
		foreach( key2 , arr2 ; t[key1] ){
			if ( t[key1][key2] == 1 && H[key1] <= H[key2] ){continue OuterLoop;}
		}
		sum += 1;
	}
	writeln(sum);
	
	
	
}



import std;


string readStr(){
	return readln().chomp();
}
T[] readLine( T = long )(){
	return readln().split().to!(T[])();
}