#include <iostream>

using namespace std;

typedef long long ll;

int main()
{
    int n, m;
    ll h[110000];
    bool a[110000];
    cin >> n >> m;

    for (int i = 0; i < n; i++)
    {
        cin >> h[i];
        a[i] = true;
    }
    for (int i = 0; i < m; i++)
    {
        int r, s;
        cin >> r >> s;
        if (h[r-1] <= h[s-1])
        {
            a[r-1] = false;
        }
        if (h[s-1] <= h[r-1])
        {
            a[s-1] = false;
        }
    }
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        s += a[i];
    }
    cout << s << endl;
    return 0;
}