#include <bits/stdc++.h>
struct sl {
  int next, id;
} e[210000];
int head[110000], fa[110000], i, j, n, m, k, l, tot[110000], sum[110000], kk,
    root, ansk[4 * 110000], ans;
int getfa(int x) {
  if (fa[x] == x)
    return x;
  else
    return fa[x] = getfa(fa[x]);
}
void add(int x, int y) {
  e[++l].next = head[x];
  e[l].id = y;
  head[x] = l;
}
void dfs(int x, int fa) {
  ansk[++ans] = x;
  tot[x] ^= 1;
  int i;
  for (i = head[x]; i != -1; i = e[i].next) {
    int v = e[i].id;
    if (v != fa) {
      dfs(v, x);
      ansk[++ans] = x;
      tot[x] ^= 1;
      if (tot[v]) {
        ansk[++ans] = v;
        tot[v] ^= 1;
        ansk[++ans] = x;
        tot[x] ^= 1;
      }
    }
  }
}
int main() {
  memset(head, -1, sizeof(head));
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) fa[i] = i;
  for (i = 1; i <= m; i++) {
    int x, y, fx, fy;
    scanf("%d%d", &x, &y);
    fx = getfa(x);
    fy = getfa(y);
    if (fx != fy) {
      fa[fx] = fy;
      add(x, y);
      add(y, x);
    }
  }
  for (i = 1; i <= n; i++) {
    scanf("%d", &tot[i]);
    if (tot[i]) sum[getfa(i)] = 1;
  }
  for (i = 1; i <= n; i++)
    if (sum[i]) kk++, root = i;
  if (kk == 0)
    printf("0");
  else if (kk > 1)
    printf("-1");
  else {
    dfs(root, -1);
    if (tot[root]) ans--;
    printf("%d\n", ans);
    for (i = 1; i <= ans; i++) printf("%d ", ansk[i]);
  }
}
