import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val m = sc.nextInt()
    val h = (1..n).map { sc.nextInt() }
    val t = Array(n) { mutableListOf<Int>()}
    repeat(m) {
        val a = sc.nextInt() - 1
        val b = sc.nextInt() - 1
        t[a].add(b)
        t[b].add(a)
    }
    println((0 until n).count {
        var isCount = true
        for (to in t[it]) {
            val toH = h[to]
            if (toH >= h[it]) {
                isCount = false
                break
            }
        }
        isCount
    })
}