#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0);
int skill[1000000];
pair<int, int> l[1000000];
int ret[1000000];
set<int> bad[1000000];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &skill[i]);
    l[i] = pair<int, int>(skill[i], i);
  }
  sort(l, l + n);
  while (k--) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a;
    --b;
    bad[a].insert(b);
    bad[b].insert(a);
  }
  int lhs = 0;
  for (int i = 0; i < n; i++) {
    while (l[lhs].first < l[i].first) lhs++;
    ret[l[i].second] = lhs;
    for (int out : bad[l[i].second]) {
      if (skill[out] < skill[l[i].second]) {
        ret[l[i].second]--;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d", ret[i]);
    if (i == n - 1)
      printf("\n");
    else
      printf(" ");
  }
}
