/*“In this world, everything is governed by balance.
 There's what you stand to gain and what you stand to lose.
 And when you think you've got nothing to lose,
  you become overconfident.”*/

#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define pob pop_back
#define vi vector<ll>
#define mp make_pair
#define sz size()
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define maxx 10000005
#define se second
#define fi first
#define edge pair<ll,ll>
#define mod 1000000007
using namespace std;
 
 //ttl=1<<n;   2^n
 //n>>=1;      n/2
 
// ¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++¦¦¦++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++¦¦¦¦¦¦¦¦¦¦+++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++¦¦¦¦¦+++++++¦++¦¦
// ¦¦¦¦¦¦¦¦++¦¦¦¦¦¦++++++¦¦¦¦+++++++++++++¦
// ¦¦¦¦¦¦¦++++++¦¦¦++++++¦¦++++++++++++++¦¦
// ¦¦¦¦¦¦¦+++++++¦¦¦+++++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++¦¦¦¦¦¦¦¦¦++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++¦¦¦¦¦¦¦¦+++++++¦ 
// ¦¦¦¦¦¦¦¦¦¦++¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦++++¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦ 
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++¦¦+¦++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++¦¦+++++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+¦¦¦¦+++¦¦¦¦++++++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++¦¦+¦¦¦¦¦+++++++¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++++++¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+¦¦¦+++++++++++¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++¦¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++¦¦¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++¦¦¦¦¦¦¦¦¦¦¦¦

//ll dp[maxx];
//ll par[maxx];

//vector<ll>v;
//sqrt(n)
/*
bool isprime(ll n)
{
    if(n==1)
    return false;
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        return false;
    }
    return true;
}
*/
////////////////////////////////////////////sieve/////////////////////////////////////////////////////
/*
void sieve()
{
    ll n=1000000;
        ll i;
    ll prime[n+1]={0};    
    ll j;
    prime[1]=1;
    prime[0]=1;
    for(i=2;i*i<=n;i++)
    {
        if(prime[i]==0)
        {
            for(j=2*i;j<=n;j=j+i)
            {
                prime[j]=1;
            }
        }
    }
    ll cnt=0;
    for(i=0;i<=n;i++)
    {
        if(prime[i]==0)
        cnt++;
        
        if(prime[cnt]==0)
        pp[i]=1;
        else
        pp[i]=0;
    }
    for(i=1;i<=n;i++)
    {
        pp[i]+=pp[i-1];
    }

}*/    




//map<ll,ll>f;
//map<pair<ll,ll>,ll>m;


////////////////////////////////////////////////matrix power///////////////////////////////////////////////////
/*ll ar[2][2];
ll I[2][2];


void mul(ll A[][2],ll B[][2],ll m)
{
    ll res[m+1][m+1];
    rep(i,m)
    {
        rep(j,m)
        {
            res[i][j]=0;
            rep(k,m)
            {
                res[i][j]=res[i][j]%mod;
                res[i][j]+=(A[i][k]*B[k][j])%mod;
                res[i][j]=res[i][j]%mod;
            }
            
        }
    }
    rep(i,m)
    {
        rep(j,m)
        {
            A[i][j]=res[i][j];
        }
    }
}

void power(ll a[][2],ll m,ll n)
{
    rep(i,m)rep(j,m)
    {
        if(i==j)
        I[i][j]=1;
        else
        I[i][j]=0;
    }
    
    while(n)
    {
        if(n%2)
        {
            //I=I*a;
            mul(I,a,2);
            n--;    
        }
        else
        {
            //a=a*a;
            mul(a,a,2);
            n/=2;
        }    
    }
    
    rep(i,m)
    {
        rep(j,m)
        {
            a[i][j]=I[i][j];
        }
    }
}
/*
void print(ll a[][maxx],ll m)
{
    rep(i,m)
    {
        rep(j,m)
        {
            cout<<(a[i][j])%mod<<" ";
        }
        cout<<endl;
    }
}
*/
//////////////////////////mod_pow////////////////////////////
/*
ll mod_pow(ll a,ll n)
{
	ll res=1;
	while(n)
	{
		if(n&1)
		{
			n--;
			res=((res)%mod)*((a)%mod);
			res=res%mod;
		}
		else
		{
			n/=2;
			a=((a%mod)*(a%mod))%mod;
		}
	}
	return res;
}*/

//do it 
// don't ask
// don't stop don't stop doing don't stop doing don't stop doing
// DON'T GIVE UP


// a^b = a+b-2*(a&b)

// Binary search (note boundaries in the caller) 
//////////////////////////////////////////////////////LIS (NLOGN)///////////////////////////////////////////////////////
/*
ll CeilIndex(std::vector<ll>& v, ll l, ll r, ll key) 
{ 
    while (r - l > 1) { 
        ll m = l + (r - l) / 2; 
        if (v[m] >= key) 
            r = m; 
        else
            l = m; 
    } 
  
    return r; 
} 
  
ll LongestIncreasingSubsequenceLength(std::vector<ll>& v) 
{ 
    if (v.size() == 0) 
        return 0; 
  
    std::vector<ll> tail(v.size(), 0); 
    ll length = 1; // always points empty slot in tail 
  
    tail[0] = v[0]; 
    for (size_t i = 1; i < v.size(); i++) { 
  
        // new smallest value 
        if (v[i] < tail[0]) 
            tail[0] = v[i]; 
  
        // v[i] extends largest subsequence 
        else if (v[i] > tail[length - 1]) 
            tail[length++] = v[i]; 
  
        // v[i] will become end candidate of an existing 
        // subsequence or Throw away larger elements in all 
        // LIS, to make room for upcoming grater elements 
        // than v[i] (and also, v[i] would have already 
        // appeared in one of LIS, identify the location 
        // and replace it) 
        else
            tail[CeilIndex(tail, -1, length - 1, v[i])] = v[i]; 
    } 
  
    return length; 
} 


*/

vector<ll>g[maxx];
int main()
{
	fast;
	
	ll n,m;
	cin>>n>>m;
	ll i;
	ll h[n];
	ll u,v;
	for(i=1;i<=n;i++)
	{
		cin>>h[i];
	}
	for(i=0;i<m;i++)
	{
		cin>>u>>v;
		g[u].pb(v);
		g[v].pb(u);
	}
	ll j=0;
	ll ma=0;
	ll cnt=0;
	for(i=1;i<=n;i++)
	{
		ma=0;
		for(j=0;j<g[i].size();j++)
		{
			ma=max(ma,h[g[i][j]]);
		}
		if(h[i]>ma)
		{
			cnt++;
		}
	}
	cout<<cnt<<endl;
	
//	cout<<<<endl;
	return 0;	
} 	
    
//cout<<"YES"<<endl;

//cout<<"NO"<<endl;

Measured memory_bytes: 242304