#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;
template <class T, class U>
using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;
const int INF = 1e9;
int n, k;
V<P<int, int> > r;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> k;
  r.resize(n);
  map<int, int> rm;
  for (int i = 0; i < n; i++) {
    int tmpr;
    cin >> tmpr;
    rm[tmpr]++;
    r[i] = make_pair(tmpr, i);
  }
  V<int> quar(n);
  for (int i = 0; i < k; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    if (r[x].first < r[y].first)
      quar[y]++;
    else if (r[x].first > r[y].first)
      quar[x]++;
  }
  sort(r.begin(), r.end());
  reverse(r.begin(), r.end());
  V<int> ans(n, 0);
  for (int i = 0; i < n; i++) {
    int tmp = n - i - 1;
    tmp -= rm[r[i].first] - 1;
    tmp -= quar[r[i].second];
    ans[r[i].second] = tmp;
    rm[r[i].first]--;
  }
  for (int i = 0; i < n; i++) cout << ans[i] << (i == n - 1 ? '\n' : ' ');
  return 0;
}
