#include <bits/stdc++.h>

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n, m;
  std::cin >> n >> m;
  std::vector<int64_t> h(n);
  std::cin >> h;

  std::vector<bool> f(n, true);

  for (int64_t i = 0; i < m; i++) {
    int64_t a, b;
    std::cin >> a >> b;
    a--;
    b--;

    if (h[a] <= h[b]) {
      f[a] = false;
    }
    if (h[b] <= h[a]) {
      f[b] = false;
    }
  }

  std::cout << std::count(f.cbegin(), f.cend(), true) << std::endl;

  return 0;
}
