import java.util.Scanner

import scala.collection.mutable


object Main {

  def main(args: Array[String]): Unit = {

    val sc = new Scanner(System.in)
    val n = sc.nextInt() //temboudai
    val m = sc.nextInt() //road count

    val h = Vector.fill(n)(sc.nextInt()) //high
    val ab = Vector.fill(m)((sc.nextInt(), sc.nextInt())) //road


    val bads = mutable.Set.empty[Int]

    def l(a: Int, b: Int): Unit = {
      (h(a - 1), h(b - 1)) match {
        case (ha, hb) if ha > hb => bads += b
        case (ha, hb) if ha < hb => bads += a
        case _ => bads += a += b
      }
    }

    ab.foreach { case (a, b) => l(a, b) }
    println((1 to n).count(!bads.contains(_)))
  }

}
