#include<bits/stdc++.h>
using namespace std;

int n, m, h[100002], ans=0;
vector<int>adjl[100002];

int main(){
	cin >> n >> m;
	for (int i=1;i<=n;i++) cin >> h[i];
	for (int i=0;i<m;i++){
		int u, v;
		cin >> u >> v;
		adjl[u].push_back(v);
		adjl[v].push_back(u);
	}
	for (int i=1;i<=n;i++){
		bool ok=1;
		for (int next : adjl[i]){
			if (h[next]>=h[i]) ok=0;
		}
		if (ok) ans++;
	}
	cout << ans << "\n";
}