import java.util.Scanner

fun main() {
	val scn = Scanner(System.`in`)
	val n = scn.nextInt()
	val m = scn.nextInt()
	val h = IntArray(n){scn.nextInt()}
	val arr = BooleanArray(n){true}
	repeat(m){
		val a = scn.nextInt()-1
		val b = scn.nextInt()-1
		if (h[a]<=h[b]) arr[a] = false
		if (h[b]<=h[a]) arr[b] = false
	}
	println(arr.count{it})
}