#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]=color;
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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgYVsxMDFdWzEwMV0sdXNlZCBbMTAxXTsKaW50IG4sIGNudD0wOwpzdHJpbmcgYW5zPSJZRVMiOwp2b2lkIGRmcyAoaW50IHYsIGludCBjb2xvcil7CnVzZWQgW3ZdPWNvbG9yOwpjbnQrKzsKZm9yIChpbnQgaT0wOyBpPG47IGkrKyl7CglpZihhW3ZdW2ldPT0xICYmIHVzZWRbaV0gPT0wKQoJZGZzIChpLCAzLWNvbG9yKTsKCWVsc2UgaWYoYVt2XVtpXT09MSAmJiB1c2VkW2ldPT1jb2xvcikKCWFucz0iTk8iOwoJfQp9CmludCBtYWluKCl7CglpbnQgbTsKCWNpbj4+bj4+bTsKCWZvciAoaW50IGk9MDsgaTxtOyBpKyspewoJaW50IGYsZTsKCWNpbj4+Zj4+ZTsKCWFbZi0xXVtlLTFdPTE7CglhW2UtMV1bZi0xXT0xOwp9Cglmb3IoaW50IGk9MDtpPG47IGkrKyl7CgkJaWYodXNlZFtpXT09MCl7CgkJCWRmcyhpLDEpOwoJCX0KCX0KCWNvdXQ8PGFuczw8ZW5kbDsKCWlmKGFucz09IllFUyIpCglmb3IoaW50IGk9MDsgaTxuOyBpKyspCgkJaWYodXNlZFtpXT09MSApCgkJY291dDw8aSsxPDwiICI7CiAgICByZXR1cm4gMDsKfQ==