#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a, b) memset(a,b,sizeof(a))
#define INF 0x3f3f3f3f
#define p_queue priority_queue
#define DBG printf("this is a input\n")
#define fi first
#define se second
#define mk(a, b) make_pair(a,b)
#define pb(a) push_back(a)
#define CLOSE ios::sync_with_stdio(0); cin.tie(0)
int n , m;
int n1 , n2 , n3;
vector <int> edge[5005];
vector <pair<int,int> > a;
vector <int> vcc[5005];
int sec[5005];
int color[5005], ok , cntx , cnty, tot = -1;
int dp[5005][5005];
void dfs(int root)
{
vcc[tot].pb(root);
if(ok)
return ;
for (int i = 0 ; i < edge[root].size() ; i ++)
{
int v = edge[root][i];
if(color[v] == 0)
{
color[v] = -color[root];
dfs(v);
if(color[v] == 1)
cntx ++;
else
cnty ++;
}
else
{
if(color[v] == color[root])
{
ok = 1;
return ;
}
}
}
}
void Deal()
{
for (int i = 1 ; i <= n ; i ++)
{
if(color[i] == 0)
{
++ tot;
ok = cnty = 0;
cntx = 1;
color[i] = 1;
dfs(i);
a.pb(mk(cntx,cnty));
if(ok == 1)
{
cout << "NO" << endl;
exit(0);
}
}
}
}
int pre[5005][5005];
int ans[5005];
int main(void)
{
CLOSE;
cin >> n >> m;
cin >> n1 >> n2 >> n3;
for (int i = 1 ; i <= m ; i ++)
{
int u , v ;
cin >> u >> v;
edge[u].pb(v) , edge[v].pb(u);
}
dp[0][0] = 1;
Deal();
for (int i = 1 ; i <= a.size(); i ++)
{
for (int j = a[i-1].fi ; j <= n2 ; j ++)
{
dp[i][j] |= dp[i - 1][j - a[i - 1].fi];
if (dp[i][j])
pre[i][j] = 1;
}
for (int j = a[i-1].se ; j <= n2 ; j ++)
{
dp[i][j] |= dp[i - 1][j - a[i - 1].se];
if (dp[i][j] && !pre[i][j])
pre[i][j] = 2;
}
}
if(dp[a.size()][n2])
{
cout << "YES" << endl;
int x = a.size() , y = n2;
while (x && y)
{
while(!pre[x][y]) x -= 1;
sec[x-1] = pre[x][y];
if(pre[x][y] == 1)
y -= a[x-1].fi;
else
y -= a[x-1].se;
x -= 1;
}
for (int i = 0 ; i < a.size() ; i ++)
{
if(sec[i] == 1)
{
for (int j = 0 ; j < vcc[i].size() ; j ++)
{
if(color[vcc[i][j]] == 1)
ans[vcc[i][j]] = 2;
else
{
if(n1)
ans[vcc[i][j]] = 1, n1 -= 1;
else
ans[vcc[i][j]] = 3, n3 -= 1;
}
}
}
else if (sec[i] == 2)
{
for (int j = 0 ; j < vcc[i].size() ; j ++)
{
if(color[vcc[i][j]] == -1)
ans[vcc[i][j]] = 2;
else
{
if(n1)
ans[vcc[i][j]] = 1, n1 -= 1;
else
ans[vcc[i][j]] = 3, n3 -= 1;
}
}
}
else
{
for (int j = 0 ; j < vcc[i].size() ; j ++)
{
if(n1)
ans[vcc[i][j]] = 1, n1 -= 1;
else
ans[vcc[i][j]] = 3, n3 -= 1;
}
}
}
for (int i = 1 ; i <= n ; i ++)
cout << ans[i];
cout << endl;
}
else
cout << "NO" << endl;
}