import std.stdio, std.string, std.conv;
import std.typecons;
import std.algorithm, std.array, std.range, std.container;
import std.math;

void main() {
	auto NM = readln.split.to!(int[]);
	auto N = NM[0], M = NM[1];
	auto H = readln.split.to!(int[]);
	
	int[] AB_max;
	AB_max.length = N;
	foreach (i; 0 .. M) {
	    auto ab = readln.split.to!(int[]);
	    AB_max[ab[0]-1] = max(AB_max[ab[0]-1], H[ab[1]-1]);
	    AB_max[ab[1]-1] = max(AB_max[ab[1]-1], H[ab[0]-1]);
	}
	
	int ans;
	foreach (i; 0 .. N) {
	    if (AB_max[i] < H[i]) ans++;
	}
	
	writeln(ans);
}