#include <stdio.h>

int main() {
	int n, m, h[100000], dd[100010] = { 0 }, ans = 0;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++) {
		scanf("%d", &h[i]);
	}
	for (int i = 0; i < m; i++) {
		int s, t;
		scanf("%d%d", &s, &t);
		if (h[s-1] >= h[t-1])dd[t]++;
		if (h[s-1] <= h[t-1])dd[s]++;
	}
	for (int i = 1; i <= n; i++) {
		if (dd[i] == 0)ans++;
		printf("%d", dd[i]);
	}
	printf("%d", ans);
	return 0;
}