import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    val line = jin.readLine().split(" ")
    val n = line[0].toInt()
    val m = line[1].toInt()
    val hs = listOf(0) + jin.readLine().split(" ").map { it.toInt() }
    val isGood = BooleanArray(n + 1) { true }
    isGood[0] = false
    for (j in 1..m) {
        val line = jin.readLine().split(" ")
        val a = line[0].toInt()
        val b = line[1].toInt()
        if (hs[a] <= hs[b]) {
            isGood[a] = false
        }
        if (hs[b] <= hs[a]) {
            isGood[b] = false
        }
    }
    println(isGood.count { it })
}