#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int arr[N];
int cnt[N];
pair<int, int> so[N];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  so[0] = {-1, -1};
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
    so[i] = {arr[i], i};
  }
  sort(so + 1, so + n + 1);
  int eq = 0;
  for (int i = 1; i <= n; i++) {
    if (so[i].first == so[i - 1].first)
      eq++;
    else
      eq = 0;
    cnt[so[i].second] = i - 1 - eq;
  }
  while (k--) {
    int u, v;
    scanf("%d%d", &u, &v);
    if (arr[u] == arr[v]) continue;
    if (arr[u] < arr[v]) swap(v, u);
    cnt[u]--;
  }
  for (int i = 1; i <= n; i++) printf("%d ", cnt[i]);
  return 0;
}
