#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    write(-x);
    return;
  }
  if (x >= 10) write(x / 10);
  putchar(x % 10 + 48);
  return;
}
inline void writeln(long long x) {
  write(x);
  puts("");
  return;
}
inline void writesp(long long x) {
  write(x);
  putchar(' ');
  return;
}
struct Node {
  long long to;
  long long nxt;
} edge[1145140];
long long n, m, root, cnt, len;
long long a[1145140], ans[1145140], head[1145140];
bool vis[1145140];
inline void add(long long x, long long y) {
  edge[++cnt].to = y;
  edge[cnt].nxt = head[x];
  head[x] = cnt;
}
inline void dfs(long long x, long long fa) {
  vis[x] = 1;
  ans[++len] = x;
  a[x] ^= 1;
  for (long long i = head[x]; i; i = edge[i].nxt) {
    long long to = edge[i].to;
    if (!vis[to]) {
      dfs(to, x);
      ans[++len] = x;
      a[x] ^= 1;
    }
  }
  if (fa && a[x]) {
    ans[++len] = fa;
    a[fa] ^= 1;
    ans[++len] = x;
    a[x] ^= 1;
  }
  return;
}
signed main() {
  n = read(), m = read();
  for (long long i = 1; i <= m; ++i) {
    long long x = read(), y = read();
    add(x, y);
    add(y, x);
  }
  for (long long i = 1; i <= n; ++i) {
    a[i] = read();
    if (a[i]) root = i;
  }
  if (root) {
    dfs(root, 0);
    for (long long i = 1; i <= n; ++i)
      if (!vis[i] && a[i]) {
        puts("-1");
        return 0;
      }
  }
  if (a[root]) {
    writeln(len - 1);
    for (long long i = 2; i <= len; ++i) writesp(ans[i]);
  } else {
    writeln(len);
    for (long long j = 1; j <= len; ++j) writesp(ans[j]);
  }
  return 0;
}
