#include <bits/stdc++.h>
using namespace std;

bool bfs(const vector<vector<int>> &G, int s, vector<int> &d) {
  d[s] = 0;
  queue<int> q;
  q.push(s);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int i = 0; i < G[v].size(); i++) {
      if (d[G[v][i]] == -1) {
        d[G[v][i]] = d[v] ^ 1;
        q.push(G[v][i]);
        continue;
      }
      else if (d[G[v][i]] == d[v]) return false;
    }
  }
  return true;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  while (true) {
    // 無向(有向)グラフの隣接リスト
    int n, m; // n:頂点数 m:辺数
    cin >> n >> m;
    if (n + m == 0) return 0;
    
    vector<vector<int>> G(n); // G:頂点数nのグラフの隣接リスト
    
    for (int i = 0; i < m; i++) {
      int u, v;
      cin >> u >> v;
      u--;
      v--;
      G[u].emplace_back(v);
      G[v].emplace_back(u); // 有向グラフではコメントアウト
    }
    
    vector<int> d(n, -1);
    if (!bfs(G, 0, d)) {
      cout << "0\n";
      continue;
    }
    
    int count_0 = 0, count_1 = 0;
    set<int> ans;
    for (int i = 0; i < n; i++) {
      if (d[i] == 0) count_0++;
      else count_1++;
    }
    if (count_0 % 2 == 0) ans.insert(count_0 / 2);
    if (count_1 % 2 == 0) ans.insert(count_1 / 2);
    
    if (ans.size() == 0) {
      cout << 0 << '\n';
    }
    else if (ans.size() == 1) {
      cout << 1 << '\n';
      cout << *ans.begin() << '\n';
    }
    else {
      cout << 2 << '\n';
      cout << *ans.begin() << '\n';
      cout << *ans.rbegin() << '\n';
    }
  }
}
