#include <bits/stdc++.h>
using namespace std;
void doRoutine() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
signed main() {
  doRoutine();
  long long int n, k;
  cin >> n >> k;
  vector<long long int> r(n);
  vector<long long int> ans(n);
  for (long long int i = 0; i < n; i++) cin >> r[i];
  vector<vector<long long int>> mp(n);
  for (long long int i = 0; i < k; i++) {
    long long int u, v;
    cin >> u >> v;
    mp[u - 1].push_back(v - 1);
    mp[v - 1].push_back(u - 1);
  }
  vector<pair<long long int, long long int>> ps;
  for (long long int i = 0; i < n; i++) {
    ps.push_back({r[i], i});
  }
  sort(ps.begin(), ps.end());
  map<long long int, long long int> kek;
  for (long long int i = 0; i < n; i++) {
    ans[ps[i].second] += i - kek[ps[i].first];
    kek[ps[i].first]++;
    for (long long int j = 0; j < mp[ps[i].second].size(); j++) {
      if (ps[i].first < r[mp[ps[i].second][j]]) ans[mp[ps[i].second][j]]--;
    }
  }
  for (long long int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << '\n';
  return 0;
}
