#include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;


int N, M;

int solve(vector<vector<int> > G){
    queue<pair<int,int>> Q;
    vector<int> used(N+2, 0);
    
    int count = 0;

    Q.push(make_pair(1,1));
    
    while(!Q.empty()){
        pair<int,int> p = Q.front(); Q.pop();
        int now = p.first;
        //cout<<now<<" <><> "<<p.second<<endl;
        if(used[now]){
            if(used[now] != p.second) return -1;
            else continue;
        }
//cout<<now<<" [][]  "<<p.second<<endl;
        used[now] = p.second;

        if(p.second == 1) count++;
        
        for(int y : G[now]){
            if(p.second == 1)Q.push(make_pair(y, p.second+1));
            else Q.push(make_pair(y, p.second-1));
        }
    }

    return count;
}

int main(void)
{

    while(true){
        vector<vector<int> > G;
        int ans;
        int u, v, n;

        
        cin>>N>>M;

        if(!N && !M) break;

        n = N;
        
        G.resize(N+1);

        for(int i = 0; i < M; i++){
            cin>>u>>v;
            G[u].push_back(v);
            G[v].push_back(u);
        }


        ans = solve(G);

        //  cout<<"count "<<ans<<endl;
        
        if(ans == -1){
            cout<<0<<endl;
        } else if(ans%2 == 0 && (n - ans)%2 == 0 && ans != n - ans){
            cout<<2<<endl;
            if(ans < (n-ans)){
                cout<<ans/2<<endl;
                cout<<(n-ans)/2<<endl;
            }else {
                cout<<(n-ans)/2<<endl;
                cout<<ans/2<<endl;
            }
        } else if(ans%2 == 0 && (n - ans)%2 == 0){
            cout<<1<<endl;
            cout<<ans/2<<endl;
        } else if(ans%2 == 0){
            cout<<1<<endl;
            cout<<ans/2<<endl;
        } else if((n-ans)%2 == 0){
            cout<<1<<endl;
            cout<<(n-ans)/2<<endl;
  
        }  else {
            cout<<0<<endl;
        }
    }
   
    return 0;
}


