fun main(args : Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    val hh = readLine()!!.split(" ").map { it.toInt() }

    val towers = Array<MutableList<Int>>(n){ mutableListOf()}

    repeat(m) {
        val (a, b) = readLine()!!.split(" ").map { it.toInt()-1 }
        towers[a].add(hh[b])
        towers[b].add(hh[a])
    }

    var cnt = 0
    towers.forEachIndexed { idx, tList ->
        val myHeight = hh[idx]
        if (tList.count { it >= myHeight } == 0) cnt++
    }

    println(cnt)
}
