#include <bits/stdc++.h>
using namespace std;
vector<bool> odd, visited, temp;
vector<unsigned> ans;
vector<vector<unsigned> > line;
inline bool dfs(const unsigned &now, const unsigned &last) {
  bool flag = 1;
  unsigned i;
  visited[now] = 1;
  for (i = 0; i < line[now].size(); ++i) {
    if (visited[line[now][i]]) continue;
    ans.push_back(now);
    odd[now] = odd[now] ^ dfs(line[now][i], now);
  }
  if (not odd[now]) {
    flag = 0;
    ans.push_back(now);
    ans.push_back(last);
  }
  ans.push_back(now);
  odd[now] = 1;
  return flag;
}
int main(void) {
  bool flag = 1;
  unsigned i, j, k, m, n, num = 0;
  cin >> n >> m;
  odd.resize(n + 1);
  visited.resize(n + 1);
  line.resize(n + 1);
  for (; m; --m) {
    cin >> j >> k;
    line[j].push_back(k);
    line[k].push_back(j);
  }
  for (i = 1; i <= n; ++i) {
    cin >> j;
    num += (odd[i] = j);
  }
  temp = odd;
  for (i = 1; i <= n; ++i)
    if (odd[i]) {
      dfs(i, 0);
      ans.push_back(0);
      break;
    }
  odd = temp;
  for (i = 0; i < ans.size(); ++i) {
    if (num) {
      if (odd[ans[i]] = not odd[ans[i]])
        num += 1;
      else
        num -= 1;
      continue;
    }
    flag = 0;
    cout << i << endl;
    for (j = 0; j < i; ++j) cout << ans[j] << " ";
    break;
  }
  if (flag) cout << (num ? -1 : 0) << endl;
  return 0;
}
