#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
  x = 0;
  T fl = 1;
  char ch = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') fl = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    x = (x << 1) + (x << 3) + (ch ^ 48);
  x *= fl;
}
template <typename T, typename... Args>
inline void read(T& x, Args&... args) {
  read(x);
  read(args...);
}
const int N = 4e5 + 5;
struct edge {
  int to, nt;
} E[N];
int H[N], ans[N], vis[N], c[N], sum[N];
int cnt = 0, n, m, ecnt, s;
void add_edge(int u, int v) {
  E[++ecnt] = (edge){v, H[u]};
  H[u] = ecnt;
}
void dfs(int u, int fa) {
  vis[u] = 1;
  sum[u]++;
  ans[++cnt] = u;
  for (int e = H[u]; e; e = E[e].nt) {
    int v = E[e].to;
    if (!vis[v]) {
      dfs(v, u);
      ans[++cnt] = u;
      sum[u]++;
    }
  }
  if (bool(sum[u] & 1) != c[u]) {
    ans[++cnt] = fa;
    sum[fa]++;
    ans[++cnt] = u;
    sum[u]++;
  }
}
int main() {
  read(n, m);
  for (int i = (1); i <= (m); i++) {
    int u, v;
    read(u, v);
    add_edge(u, v);
    add_edge(v, u);
  }
  for (int i = (1); i <= (n); i++) {
    read(c[i]);
    if (c[i]) s = i;
  }
  if (s) {
    dfs(s, -1);
    for (int i = (1); i <= (n); i++)
      if (!vis[i] && c[i]) {
        printf("-1\n");
        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]);
  return 0;
}
