#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define LL long long
#define MOD 1000000007
#define INF 2000000000000
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
ll N, M, K, H, W, L, R, l, r, u, sum, Q;
LL ans=0;
LL no;

string s, t;

LL gcd(int p, int q) {
	if (p % q == 0)return q;
	return gcd(q, p % q);

}


int main() {
	cin >> N >> M;
	
	vector<LL> h(N + 1),v(N + 1),a(M),b(M);
	for (int i = 1; i <= N; i++) {
		cin >> h[i];
		v[i] = -1;
	}
	for (int i = 0; i < M; i++) {
		cin >> a[i] >> b[i];
		v[a[i]] = max(v[a[i]], h[b[i]]);
		v[b[i]] = max(v[b[i]], h[a[i]]);
	}
	
	for (int i = 1; i <= N; i++) {
		if (v[i] < h[i])ans++;
	}

	cout << ans<<endl;
	return 0;
}

