#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main (void)
{
    unsigned long h[100000], *G[100000];
    long i, j, n, m, a, b, ans = 0;

    for (i = 0; i < 100000; i++) {
        G[i] = (unsigned long *)malloc(sizeof(unsigned long) * 100000);
        memset(G[i], 0, sizeof(unsigned long) * 100000);
    }

    scanf("%lo %lo", &n, &m);

    for (i = 0; i < n; i++) {
        scanf("%lu", &(h[i]));
    }

    for (i = 0; i < m; i++) {
        scanf("%lo %lo", &a, &b);
        G[a - 1][b - 1] = 1;
        G[b - 1][a - 1] = 1;
    }

    for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
            if (G[i][j] == 0) continue;
            if (h[i] <= h[j]) break;
        }
        if (j == n) {
            ans++;
        }
    }

    printf("%lo", ans);

    return 0;
}

