#include <stdio.h>

int main(void) {
    int N, M, H[100005], A[100005], B[100005], x, b[100005], i;
    scanf("%d%d", &N, &M);
    for (i=1; i<=N; i++) scanf("%d", &H[i]);
    for (i=1; i<=M; i++) scanf("%d%d", &A[i], &B[i]);
    for (i=1; i<=N; i++) b[i]=1;
    for (i=1; i<=M; i++) {
        if (H[A[i]]>H[B[i]]) b[B[i]]=0;
        else if (H[A[i]]==H[B[i]]) {
            b[A[i]]=0;
            b[B[i]]=0;
        }
        else b[A[i]]=0;
    }
    x=0;
    for (i=1; i<=N; i++) x+=b[i];
    printf("%d", x);
    return 0;
}
