#include <stdio.h>

int c[100001] = {0}, s;

int main() {
    int n, m, h[100001], a, b;
    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &h[i]);
    for (int i = 0; i < m; i++) {
        scanf("%d %d", &a, &b);
        if (h[a] <= h[b]) c[a] = 1;
        if (h[b] <= h[a]) c[b] = 1;
    }
    for (int i = 1; i <= n; i++)
        if (!c[i])s++;
    printf("%d", s);
    return 0;
}