#include <bits/stdc++.h>
using namespace std;
const int p = 1e9 + 7;
const int lim = 1e6;
void pre_io() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int32_t main() {
  pre_io();
  int n, m;
  cin >> n >> m;
  map<int, int> mp, compr;
  vector<int> v(n);
  vector<pair<int, int> > qrl(m);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mp[v[i]]++;
  }
  for (int i = 0; i < m; i++) {
    cin >> qrl[i].first >> qrl[i].second;
    qrl[i].first--;
    qrl[i].second--;
  }
  int idx = 0;
  vector<int> cnt(mp.size()), pref(mp.size() + 1);
  for (auto it : mp) {
    int skill = it.first, boys = it.second;
    compr[skill] = idx;
    cnt[idx] = boys;
    idx++;
  }
  pref[0] = 0;
  for (int i = 0; i < cnt.size(); i++) pref[i + 1] = pref[i] + cnt[i];
  vector<int> res(n);
  for (int i = 0; i < n; i++) {
    idx = compr[v[i]];
    res[i] = pref[idx];
  }
  for (int i = 0; i < m; i++) {
    if (v[qrl[i].first] < v[qrl[i].second]) {
      res[qrl[i].second]--;
    } else if (v[qrl[i].second] < v[qrl[i].first]) {
      res[qrl[i].first]--;
    }
  }
  for (int i = 0; i < n; i++) cout << res[i] << " ";
}
