#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
int c[N], ft[N], mark[N], n, m, f;
vector<int> g[N], ans;
void out() {
  cout << -1 << endl;
  exit(0);
}
int dfs1(int v) {
  mark[v] = 1;
  int tot = c[v];
  for (int i = 0; i < g[v].size(); i++)
    if (!mark[g[v][i]]) tot += dfs1(g[v][i]);
  return ft[v] = tot;
}
void flip(int v) {
  if (v == -1) return;
  ans.push_back(v);
  f += c[v] ? -1 : 1;
  c[v] ^= 1;
}
int dfs2(int v, int p) {
  if (!ft[v]) return 0;
  mark[v] = 1;
  flip(v);
  if (!f) return 0;
  for (int i = 0; i < g[v].size(); i++)
    if (!mark[g[v][i]]) {
      dfs2(g[v][i], v);
      if (!f) return 0;
    }
  if (!c[v])
    flip(p);
  else {
    flip(p);
    flip(v);
    flip(p);
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  while (m--) {
    int l, r;
    cin >> l >> r;
    g[l].push_back(r);
    g[r].push_back(l);
  }
  int st = -1;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    if (c[i]) st = i;
    f += c[i];
  }
  if (st > 0) {
    dfs1(st);
    fill(mark, mark + N, 0);
    dfs2(st, -1);
  }
  if (f) out();
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << endl;
}
