#include <iostream>
using namespace std;
int a[101][101],used [101];
int n, cnt=0;
string ans="YES";
void dfs (int v, int color){
used [v]=1;
cnt++;
for (int i=0; i<n; i++){
if(a[v][i]==1 && used[i] ==0)
dfs (i, 3-color);
else if(a[v][i]==1 && used[i]==color)
ans="NO";
}
}
int main(){
int m;
cin>>n>>m;
for (int i=0; i<m; i++){
int f,e;
cin>>f>>e;
a[f-1][e-1]=1;
a[e-1][f-1]=1;
}
for(int i=0;i<n; i++){
if(used[i]==0){
dfs(i,1);
}
}
cout<<ans<<endl;
if(ans=="YES")
for(int i=0; i<n; i++)
if(used[i]==1 )
cout<<i+1<<" ";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgYVsxMDFdWzEwMV0sdXNlZCBbMTAxXTsKaW50IG4sIGNudD0wOwpzdHJpbmcgYW5zPSJZRVMiOwp2b2lkIGRmcyAoaW50IHYsIGludCBjb2xvcil7CnVzZWQgW3ZdPTE7CmNudCsrOwpmb3IgKGludCBpPTA7IGk8bjsgaSsrKXsKCWlmKGFbdl1baV09PTEgJiYgdXNlZFtpXSA9PTApCglkZnMgKGksIDMtY29sb3IpOwoJZWxzZSBpZihhW3ZdW2ldPT0xICYmIHVzZWRbaV09PWNvbG9yKQoJYW5zPSJOTyI7Cgl9Cn0KaW50IG1haW4oKXsKCWludCBtOwoJY2luPj5uPj5tOwoJZm9yIChpbnQgaT0wOyBpPG07IGkrKyl7CglpbnQgZixlOwoJY2luPj5mPj5lOwoJYVtmLTFdW2UtMV09MTsKCWFbZS0xXVtmLTFdPTE7Cn0KCWZvcihpbnQgaT0wO2k8bjsgaSsrKXsKCQlpZih1c2VkW2ldPT0wKXsKCQkJZGZzKGksMSk7CgkJfQoJfQoJY291dDw8YW5zPDxlbmRsOwoJaWYoYW5zPT0iWUVTIikKCWZvcihpbnQgaT0wOyBpPG47IGkrKykKCQlpZih1c2VkW2ldPT0xICkKCQljb3V0PDxpKzE8PCIgIjsKICAgIHJldHVybiAwOwp9