// Author - Abhishek giri

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define mod 100000000007
#define V(type) vector<type> 
#define all(c) ((c).begin(),(c).end())
#define in(var) cin>>(var)
#define out(var) cout<<(var)
#define on(var) cout<<var<<"\n"
#define f(i,n) for(ll i = 0 ; i < n ;i++)
#define mfor(i,init,n,b) for(ll i = (init) ; i < (n) ; i+= (b))
#define cfor(i,c) for(auto i = (c).begin() ; i!= (c).end(); i++)

/*##################################################################################*/


/*
bitset<10000000> prime ;
void calculateprime()
{
    //calculating primes
    prime[0] = prime[1] = 1 ;
    for(int i = 2 ; (ll)i*i <= 10000000 ; i++)
    {
        if(prime[i] == 0)
        {
            for(ll j = i*i ; j <= 10000000 ; j += i )
            {
                prime[j] = 1 ;
            }
        }
    }
}
*/

bool isprime(long n)
{
    for(int i = 2 ; (ll) i*i <= n ; i++)
    {
        if(n % i == 0){
            return false;
        }
    }
    return true;
}


/*
ll fib(int n) 
{ 
  ll a = 0, b = 1, c, i; 
  if( n == 0) 
    return a; 
  for (i = 2; i <= n; i++) 
  { 
    c = (a + b); 
    a = b; 
    b = c; 
  } 
  return b; 
}
*/


ll gcd(ll a, ll b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
} 


ll findgrouplcm(ll arr[], ll n) 
{ 
    ll ans = arr[0]; 
  
    for (ll i = 1; i < n; i++) 
        ans = (arr[i] * (ans/(gcd(arr[i], ans))));
  
    return ans; 
}



ll powerwithmod(ll x, unsigned ll y, ll p)  
{  
    ll res = 1;    
  
    x = x % p; 
   
    if (x == 0) return 0;
  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % p;  
   
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}

ll setBitNumber(ll n) 
{ 
    n |= n >> 1; 
    n |= n >> 2; 
    n |= n >> 4; 
    n |= n >> 8; 
    n |= n >> 16; 
    n |= n >> 32;
    n = n + 1; 
  
    return (n >> 1); 
} 
void decToBinary(ll n,string &s) 
{ 
    for (int i = 63; i >= 0; i--) { 
        int k = n >> i; 
        if (k & 1) 
            s += "1"; 
        else
            s += "0"; 
    } 
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll n,m;
        in(n)>>m;
        ll arr[n];
        vector<vector<ll> > v(n);
        f(i,n)  in(arr[i]);
        while(m--){
            ll a,b;
            in(a)>>b;
            v[a-1].pb(b-1);
            v[b-1].pb(a-1);
        }
        
        /*
        for(int i = 0 ; i  <v.size() ; i++){
            for(int j = 0 ; j  <v[i].size() ; j++){
                cout<<v[i][j]<<" ";
            }
            cout<<endl;
        }
        */
        
        ll cnt = 0 ;
        for(ll i = 0 ;i < v.size() ; i++){
            if(v[i].empty()){
                ++cnt;
                continue;
            }
            else{
                ll h = arr[i];
                bool ok = true;
                for(ll j =  0 ; j  < v[i].size() ; j++){
                    if(arr[v[i][j]] >= h){
                        ok = false;
                        break;
                    }
                }
                if(ok)  ++cnt;
            }
        }
        out(cnt);
        
    }
    return 0;
}

Measured memory_bytes: 9736