using System;
using System.Collections;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Linq;
using System.Numerics;
using System.Security.Cryptography;
using System.Text;
using System.Threading;

namespace ForATCODER
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //      int N =s2i(Console.ReadLine());
            int[] nm = s2iarray(Console.ReadLine().Split(' '));
            ulong[] tnb_h = s2larray2(Console.ReadLine().Split(' '));
            List<ulong>[] tnb_m = new List<ulong>[nm[0]];  //michi from
            int[] found = new int[nm[0]];
            //init
            for (int i = 0; i < nm[0]; i++)
            {
                tnb_m[i] = new List<ulong>();
            }
            //hight
            int c = 0;
            for (int i = 0; i < nm[1]; i++)
            {
                ulong[] ab = s2larray(Console.ReadLine().Split(' '));
                //int h1 = tnb_h[ab[0]-1];
                //int h2 = tnb_h[ab[1] - 1];
                tnb_m[ab[1] - 1].Add(ab[0] - 1);
                tnb_m[ab[0] - 1].Add(ab[1] - 1);
                found[ab[0] - 1] = 1;
                found[ab[1] - 1] = 1;
            }

            //check
            for (int i = 0; i < nm[0]; i++)
            {
                ulong h = tnb_h[i];
                bool ok = true;
                for (int j = 0; j < tnb_m[i].Count; j++)
                {
                    ulong h_ = tnb_h[tnb_m[i][j]];
                    if (h <= h_) { ok = false; break; }
                }
                if (ok) { c++; }
            }
        //    c += found.Count(n => n == 0);
            RESULT(c);

        }
        public static bool checka(int[] a, int m)
        {
            int back = 1;
            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] >= 1 && a[i] <= m)
                {
                    if (a[i] >= back)
                    {
                        back = a[i];
                    }
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    return false;
                }
            }
            return true;
        }
        public static ulong pow(int a, int b)
        {
            ulong res = 1;
            for (int i = 0; i < b; i++)
            {
                res *= (ulong)a;
            }
            return res;
        }
        static int s2i(String s)
        {
            return Convert.ToInt32(s);
        }
        static ulong s2l(String s)
        {
            return Convert.ToUInt64(s);
        }
        static void RESULT(double res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(long res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(ulong res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(int res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(String res)
        {
            Console.WriteLine(res);
        }
        static String[] ReadLineAll(int count)
        {
            String[] res = new String[count];
            for (int i = 0; i < count; i++)
            {
                res[i] = Console.ReadLine();
            }
            return res;
        }

        static int[] s2iarray(String[] src)
        {
            int len = src.Length;
            int[] res = new int[len];
            for (int i = 0; i < len; i++)
            {
                res[i] = Convert.ToInt32(src[i]);
            }
            return res;
        }
        static ulong[] s2larray(String[] src)
        {
            int len = src.Length;
            ulong[] res = new ulong[len];
            for (int i = 0; i < len; i++)
            {
                res[i] = Convert.ToUInt64(src[i]);
            }
            return res;
        }
        static ulong[] s2larray2(String[] src)
        {
            int len = src.Length;
            ulong[] res = new ulong[len];
            for (int i = 0; i < len; i++)
            {
                res[i] = Convert.ToUInt64(src[i]);
            }
            return res;
        }
    }
}


Measured memory_bytes: 58224