#include <bits/stdc++.h>
using namespace std;
const int SIZE = 5e5 + 5;
int n, m, num, cnt;
int head[SIZE], a[SIZE], vis[SIZE], ans[SIZE];
struct node {
  int to, nxt;
} edge[SIZE << 1];
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline int read() {
  int a = 0, b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
}  // namespace ae86
using ae86::read;
void addEdge(int u, int v) { edge[++num] = (node){v, head[u]}, head[u] = num; }
void dfs(int u, int fa) {
  vis[u] = 1, ans[++cnt] = u, a[u] ^= 1;
  for (int i = head[u], v; i; i = edge[i].nxt) {
    v = edge[i].to;
    if (v == fa || vis[v]) continue;
    dfs(v, u);
    ans[++cnt] = u, a[u] ^= 1;
  }
  if (a[u]) ans[++cnt] = fa, a[fa] ^= 1, ans[++cnt] = u, a[u] ^= 1;
}
int main() {
  int root = 0;
  n = read(), m = read();
  for (int i = 1, u, v; i <= m; ++i) {
    u = read(), v = read();
    addEdge(u, v);
    addEdge(v, u);
  }
  for (int i = 1; i <= n; ++i) {
    a[i] = read();
    if (a[i]) root = i;
  }
  dfs(root, -1);
  for (int i = 1; i <= n; ++i) {
    if (!vis[i] && a[i]) {
      puts("-1");
      return 0;
    }
  }
  if (cnt > 1 && ans[cnt - 1] == -1) cnt -= 3;
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; ++i) printf("%d ", ans[i]);
  puts("");
  return 0;
}
