#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& cout, vector<T> V) {
  cout << "[ ";
  for (auto v : V) cout << v << ' ';
  return cout << ']';
}
template <class L, class R>
ostream& operator<<(ostream& cout, pair<L, R> P) {
  return cout << '(' << P.first << ',' << P.second << ')';
}
long long int n, m;
vector<vector<long long int>> conn;
vector<long long int> col;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  conn.resize(n);
  long long int n1;
  cin >> n1;
  long long int n2;
  cin >> n2;
  long long int n3;
  cin >> n3;
  for (long long int i = 0; i < (m); i++) {
    long long int x;
    cin >> x;
    long long int y;
    cin >> y;
    x--, y--;
    conn[x].push_back(y);
    conn[y].push_back(x);
  }
  vector<pair<long long int, long long int>> a;
  vector<vector<vector<long long int>>> b;
  col.resize(n, -1);
  for (long long int i = 0; i < (n); i++) {
    if (col[i] == -1) {
      b.push_back({{}, {}});
      col[i] = 0;
      queue<long long int> q;
      q.push(i);
      vector<long long int> count(2);
      while (q.size()) {
        long long int node = q.front();
        q.pop();
        count[col[node]]++;
        b.back()[col[node]].push_back(node);
        for (long long int j : conn[node]) {
          if (col[j] == -1) {
            col[j] = 1 - col[node];
            q.push(j);
          } else if (col[j] == col[node]) {
            cout << "NO\n";
            return 0;
          }
        }
      }
      a.push_back({count[0], count[1]});
    }
  }
  vector<vector<long long int>> dp(a.size() + 1, vector<long long int>(n + 1));
  dp[0][0] = 1;
  for (long long int i = 1; i <= (long long int)a.size(); i++) {
    for (long long int j = 0; j <= n; j++) {
      if (j >= a[i - 1].first) dp[i][j] |= dp[i - 1][j - a[i - 1].first];
      if (j >= a[i - 1].second) dp[i][j] |= dp[i - 1][j - a[i - 1].second];
    }
  }
  if (!dp.back()[n2]) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    vector<long long int> ans(n);
    long long int ind = a.size(), ct = n2;
    while (ind) {
      if (ct - a[ind - 1].first >= 0 && dp[ind - 1][ct - a[ind - 1].first]) {
        for (long long int i : b[ind - 1][0]) {
          ans[i] = 2;
        }
        ct -= a[ind - 1].first;
      } else {
        assert(dp[ind - 1][ct - a[ind - 1].second]);
        for (long long int i : b[ind - 1][1]) {
          ans[i] = 2;
        }
        ct -= a[ind - 1].second;
      }
      ind--;
    }
    for (long long int i = 0; i < (n); i++) {
      if (!ans[i]) {
        if (n1) {
          ans[i] = 1;
          n1--;
        } else {
          ans[i] = 3;
        }
      }
    }
    for (long long int i = 0; i < (n); i++) cout << ans[i];
    cout << '\n';
  }
  cerr << "Time : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC
       << "ms\n";
  ;
}
