function Main(_input) {
    var lines = _input.split("\n");
    var first = lines.shift().split(' ');
    var dai = first[0] * 1;
    var road = first[1] * 1;
    var heights = lines.shift().split(' ').map((item) => item*1);
    var r = Array(dai).fill(true);

    for (var i = 0; i < road; i++) {
        var s = lines[i].split(' ');
        var f = s[0]*1 - 1;
        var n = s[1]*1 - 1;

        if (heights[f] <= heights[n]) r[f] = false;
        if (heights[n] <= heights[f]) r[n] = false;
    }

    var count = 0;
    for (var i = 0; i < dai; i++) {
        if (r[i]) count++;
    }

    console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));