#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, m, pos[N], ans[N];
vector<int> g[N];
map<int, int> tot;
struct data {
  int a, i;
} a[N];
bool cmp(data u, data v) { return u.a > v.a; }
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i].a), a[i].i = i;
    ++tot[a[i].a];
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; ++i) pos[a[i].i] = i;
  for (int i = 1, x, y; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    x = pos[x], y = pos[y];
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int cnt = n;
  a[0].a = -1;
  for (int i = 1; i <= n; ++i) {
    int s = g[i].size();
    if (a[i].a != a[i - 1].a) cnt -= tot[a[i].a];
    ans[a[i].i] = cnt;
    for (int j = 0; j < s; ++j)
      if (g[i][j] > i && a[g[i][j]].a != a[i].a) --ans[a[i].i];
  }
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
  return 0;
}
