import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

import scala.collection.mutable.ArrayBuffer

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))

    val Array(n, m) = in.readLine().split("\\s+").map(_.toInt)
    val hs = in.readLine().split("\\s+").map(_.toInt)
    val roads = Array.fill(n)(ArrayBuffer.empty[Int])

    for (i <- 0 until m) {
      val (a, b) = in.readLine().split("\\s+") match {
        case Array(a, b) => (a.toInt - 1, b.toInt - 1)
      }
      roads(a).append(b)
      roads(b).append(a)
    }

    var count = 0

    for (i <- 0 until n) {
      val h = hs(i)
      val otherHs = roads(i).map(hs(_))
      if (otherHs.forall(_ < h)) {
        count += 1
      }
    }

    out.println(count)
    out.flush()
  }
}
