#ifndef _UNICODE
#define _UNICODE
#endif
#ifndef UNICODE
#define UNICODE
#endif

#include <stdio.h>
#include <wchar.h>

#include <algorithm>
#include <bitset>
#include <complex>
#include <cstring>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <unordered_map>

using namespace std;

#define PB push_back
#define MP make_pair
#define F first
#define int_pair second
#define SZ(X) ((int64_t)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define S1(X) scanf("%d", &(X))
#define S2(X, Y) scanf("%d%d", &(X), &(Y))
#define S3(X, Y, Z) scanf("%lld%lld%lld", &(X), &(Y), &(Z))
#define P1(X) printf("%lld", (X))
#define P2(X) printf("%lld\n", (X))
#define _ printf(" ");
#define __ printf("\n");
#define LEN(X) strlen(X)
#define MEM(a, b) memset(a, (b), sizeof(a))
#define MOD 1000000007
#define EPS 1e-9
#define gcd(a, b) __gcd(a, b)
#define IOS ios_base::sync_with_stdio(0);
#define EACH(I, V) for (auto I : V)
#define REP(I, N) for (int64_t I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int64_t I = (A); I < (B); ++I)
#define REPPP(i, begin, end)                                                   \
  for (__typeof(end) i = (begin) - ((begin) > (end));                          \
       i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

template<class T>
size_t choose(T a, T b, size_t src1, size_t src2) {
#if defined(__clang__) && defined(__x86_64)
  size_t res = src1;
  asm("cmpq %1, %2; cmovaeq %4, %0"
  :
  "=q" (res)
  :
  "q" (a),
  "q" (b),
  "q" (src1),
  "q" (src2),
  "0" (res)
  :
  "cc");
  return res;
#else
  return b >= a ? src2 : src1;
#endif
}

#define FOR(x, xs) for (__typeof( (xs).begin() ) x = (xs).begin(); x != (xs).end(); x++)

int64_t u = pow(10, 11) * 2;
int v = pow(u, 2.0 / 3);
int w = sqrt(u);

int64_t sum = 0;
vector<bool> isPrime(v + 1);

int nextPrime(int p) {
  while (!isPrime[++p]) {
  }
  return p;
}

vector<int64_t> divisors(vector<int64_t> &ps) {
  vector<int64_t> ds(1, 1), tmp; // 1 is divisor
  int64_t q = 1;
  FOR(p, ps) {
    if (*p != q) {
      tmp.clear();
      FOR(d, ds) {
        tmp.push_back(*d);
      } // tmp <- ds
    }
    FOR(t, tmp) {
      *t *= *p; // tmp <- map (p*) tmp
      ds.push_back(*t);
    }
    q = *p;
  }
  sort(ds.begin(), ds.end());
  return ds;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  int x, y;
  set<int> _set;
  
  long long n, m, count = 0;
  cin >> n >> m;
  
  vector<long long> _map(n);
  vector<vector<int>> arr(n);
  
  for (int i = 0; i < n; i++) {
    cin >> _map.at(i);
  }
  
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    _set.insert(x - 1);
    _set.insert(y - 1);
    arr.at(x - 1).push_back(y - 1);
    arr.at(y - 1).push_back(x - 1);
  }
  
  for (int i = 0; i < n; i++) {
    bool flag = 1;
    if (_set.count(i) != 0) {
      for (int j = 0; j < arr.at(i).size(); j++) {
        if (_map.at(i) <= _map.at(arr.at(i).at(j))) {
          flag = 0;
          break;
        }
      }
      if (flag) {
        count++;
      }
    } else {
      count++;
    }
  }
  cout << count << '\n';
}


Measured memory_bytes: 17000