#include <bits/stdc++.h>
using namespace std;
int ans[200005 << 2], cnt, n, m, rt;
vector<int> g[200005];
bool v[200005], c[200005];
void add(int x) { c[ans[++cnt] = x] ^= 1; }
bool ok() {
  for (int i = 1; i <= n; ++i)
    if (c[i]) return 0;
  return 1;
}
void dfs(int u) {
  add(u), v[u] = 1;
  for (typeof(g[u].begin()) x = g[u].begin(); x != g[u].end(); ++x) {
    if (v[*x]) continue;
    dfs(*x), add(u);
    if (c[*x]) add(*x), add(u);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int u, v;
  for (int i = 1; i <= m; ++i)
    scanf("%d%d", &u, &v), g[u].push_back(v), g[v].push_back(u);
  for (int i = 1; i <= n; ++i) scanf("%d", &c[i]), rt = c[i] ? i : rt;
  dfs(rt);
  if (c[rt]) --cnt, c[rt] = 0;
  if (ok()) {
    printf("%d\n", cnt);
    for (int i = 1; i <= cnt; ++i)
      printf("%d%c", ans[i], (i == cnt) ? '\n' : ' ');
  } else
    puts("-1");
  return 0;
}
