#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
int a[N];
vector<int> b[N];
struct rt {
  int x, index, y;
} c[N];
bool cmp(rt a, rt b) { return a.x < b.x; }
bool cmp1(rt a, rt b) { return a.index < b.index; }
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    c[i].x = a[i];
    c[i].index = i;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    b[u].push_back(v);
    b[v].push_back(u);
  }
  sort(c + 1, c + n + 1, cmp);
  c[1].y = 0;
  for (int i = 2; i <= n; i++) {
    int l, r, mid;
    l = 1, r = i;
    while (l < r - 1) {
      mid = (l + r) >> 1;
      if (c[mid].x >= c[i].x)
        r = mid;
      else
        l = mid;
    }
    if (c[l].x < c[i].x) {
      c[i].y = l;
      int u = c[i].index;
      for (int j = 0; j < b[u].size(); j++) {
        int v = b[u][j];
        if (a[v] < a[u]) c[i].y--;
      }
    } else {
      c[i].y = 0;
    }
  }
  sort(c + 1, c + 1 + n, cmp1);
  for (int i = 1; i <= n; i++) {
    cout << c[i].y;
    if (i < n) cout << " ";
  }
  cout << endl;
  return 0;
}
