#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for (ll i = (begin); i < (end); i++)
#define REP(i, n) FOR(i, 0, n)
#define IFOR(i, begin, end) for (ll i = (begin)-1; i >= (end); i--)
#define IREP(i, n) IFOR(i, n, 0)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(), greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v)                                                              \
  cout << #v << "=(" << v[0];                                                  \
  FOR(i_debug, 1, v.size()) { cout << "," << v[i_debug]; }                     \
  cout << ")" << endl;
#define mdebug(m)                                                              \
  cout << #m << "=" << endl;                                                   \
  REP(i_debug, m.size()) {                                                     \
    REP(j_debug, m[i_debug].size()) { cout << m[i_debug][j_debug] << ","; }    \
    cout << endl;                                                              \
  }
#define Lower_bound(v, x)                                                      \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x)                                                      \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)

#define ll long long
// #define f first
// #define s second
#define mp make_pair
#define pb push_back
#define INF 1000000000000000000

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;
using bvec = vector<bool>;
using Pvec = vector<Pii>;

template <typename T> void readv(vector<T> &a) { REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a) {
  REP(i, a.size()) {
    cin >> a[i];
    a[i]--;
  }
}

ll mod = 1000000007;

struct UnionFind {
  vector<ll> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
  vector<ll> memnum;

  UnionFind(ll N) { //最初は全てが根であるとして初期化
    init(N);
  }

  void init(ll N) {
    par.resize(N);
    memnum.resize(N);
    for (ll i = 0; i < N; i++) {
      par[i] = i;
      memnum[i] = 1;
    }
  }

  ll root(ll x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (par[x] == x)
      return x;
    return par[x] = root(par[x]);
  }

  void unite(ll x, ll y) { // xとyの木を併合
    ll rx = root(x);       // xの根をrx
    ll ry = root(y);       // yの根をry
    if (rx == ry)
      return; // xとyの根が同じ(=同じ木にある)時はそのまま
    par[rx] =
        ry; // xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    //
    memnum[ry] += memnum[rx];
    memnum[rx] = 0;
  }

  bool same(ll x, ll y) { // 2つのデータx, yが属する木が同じならtrueを返す
    ll rx = root(x);
    ll ry = root(y);
    return rx == ry;
  }

  //////////////

  bool is_root(ll x) { return par[x] == x; }

  ll num(ll x) { return memnum[root(x)]; }
};

int main() {
  ll N, M;
  cin >> N >> M;
  vec H(N);
  REP(i, N) { cin >> H[i]; }
  vec A(M), B(M);

  vector<vec> connected(N, vec(0));

  REP(i, M) {
    cin >> A[i] >> B[i];
    A[i]--;
    B[i]--;
    connected[A[i]].pb(B[i]);
    connected[B[i]].pb(A[i]);
  }
  ll ans = 0;
  bool isans = true;
  REP(i, N) {
    // vdebug(connected[i]);
    isans = true;
    REP(j, connected[i].size()) {
      if (H[i] <= H[connected[i][j]]) {
        isans = false;
        break;
      }
    }
    if (isans)
      ans++;
    // cout << i << endl;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 11440