import java.util

import scala.io.StdIn.readLine
import scala.io.StdIn.readInt
import java.util.Scanner
import java.util.ArrayList

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt()
  val M = sc.nextInt()
  val h = new Array[Int](N)
  for(i <- 1 to N)h(i-1) = sc.nextInt()
  var l = new Array[Boolean](N)
  for(i <- 1 to M){
    val a = sc.nextInt()
    val b = sc.nextInt()
    if(h(a-1) >= h(b-1))l(b-1) = true
    if(h(b-1) >= h(a-1))l(a-1) = true
  }
  println(l.count(a=>a==false))




}