#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> r(n + 1);
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    r[i + 1] = x;
    v.push_back(make_pair(x, i + 1));
  }
  vector<vector<int>> u(n + 1);
  for (int i = 0; i < k; i++) {
    int a, b;
    cin >> a >> b;
    u[a].push_back(b);
    u[b].push_back(a);
  }
  vector<int> cnt(n + 1);
  sort(v.begin(), v.end());
  vector<int> ans(n + 1);
  int cnt1 = 0, cnt2 = 1;
  for (int i = 0; i < n; i++) {
    if (i != 0) {
      if (v[i].first == v[i - 1].first) {
        cnt2++;
      } else {
        cnt1 += cnt2;
        cnt2 = 1;
      }
    }
    int cur = v[i].second;
    ans[cur] = cnt1 - cnt[cur];
    for (int j = 0; j < u[cur].size(); j++) {
      if (r[u[cur][j]] != r[cur]) {
        cnt[u[cur][j]]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << ' ';
  }
  cout << endl;
}
