func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}


struct Tower: Hashable {
    let index: Int
    let height: Int
    var adjucents: [Tower] = []
}

struct Load {
    var start: Tower
    var end: Tower
}

func mainC() {
    let (N, M) = readTwoInts()
    var towers = readInts().enumerated().map { (index, element) in Tower(index: index, height: element) }

    let loads = (0..<M).map { _ -> Load in
        let (start, end) = readTwoInts()

        return Load(start: towers[start - 1], end: towers[end - 1])
    }

    // 分類
    for load in loads {
        towers[load.start.index].adjucents.append(load.end)
        towers[load.end.index].adjucents.append(load.start)
    }

    // 調べる
    var count = 0
    for tower in towers {
        var isPeak = true

        let set = Set(tower.adjucents)
        for adjucent in set {
            if tower.height <= adjucent.height {
                isPeak = false
            }
        }

        if isPeak {
            count += 1
        }
    }

    print(count)
}
mainC()