import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdlib;

immutable int INF = 1 << 29;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto H = readln.split.map!(to!int).array;
    auto G = new int[][](N);
    foreach (i; 0..M) {
        s = readln.split.map!(to!int);
        auto u = s[0] - 1;
        auto v = s[1] - 1;
        G[u] ~= v;
        G[v] ~= u;
    }

    int ans = 0;
    foreach (i; 0..N) {
        if (G[i].map!(j => H[j] < H[i]).all) {
            ans += 1;
        }
    }

    ans.writeln;
}
