import std;

void main() {
    int n, m; scan(n, m);
    auto hs = readints;
    int[][] adj;
    foreach (_; 0..n) adj ~= [[]];
    foreach (_; 0..m) {
        int a, b; scan(a, b);
        a--; b--;
        adj[a] ~= b;
        adj[b] ~= a;
    }

    int ans = 0;
    for (int i = 0; i < hs.length; i++) {
        bool ok = true;
        foreach (e; adj[i]) {
            if (hs[i] <= hs[e]) {
                ok = false;
                break;
            }
        }
        if (ok) ans++;
    }
    writeln(ans);
}

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;
