

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

	ulong[ulong][ulong] t;
	ulong[ulong] pointList;
	
	foreach( key, h ; H ){
		pointList[key] = h;
		foreach( key2,hh ; H ){
			t[key][key2] = 0;
		}
		
	}
	
	foreach( i ; 0..NM[1] ){
		auto AB = readLine!ulong();
		AB[0]-=1;AB[1]-=1;
		t[AB[0]][AB[1]] = t[AB[1]][AB[0]] = 1;
	}
	
	
	ulong sum;
	OuterLoop:foreach( key1 , h ; H ){
		foreach( key2 , hh ; H ){
			if ( t[key1][key2] == 1 && pointList[key1] <= pointList[key2] ){continue OuterLoop;}
		}
		sum += 1;
	}
	writeln(sum);
	
	
	
}



import std;

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