#include <bits/stdc++.h>
struct ed {
  int v, next;
};
ed edge[2 * 100005];
int head[100005];
int used[100005];
int a[100005];
int path[4 * 100005];
int len;
void dfs(int u) {
  int v;
  path[len++] = u;
  used[u] = 1;
  a[u] ^= 1;
  for (int i = head[u]; i; i = edge[i].next) {
    v = edge[i].v;
    if (used[v]) continue;
    dfs(v);
    path[len++] = u;
    a[u] ^= 1;
    if (a[v]) {
      path[len++] = v;
      path[len++] = u;
      a[v] ^= 1;
      a[u] ^= 1;
    }
  }
}
int main() {
  int n, m, M = 1;
  int u, v, s = 1;
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &u, &v);
    edge[M].v = v;
    edge[M].next = head[u];
    head[u] = M++;
    edge[M].v = u;
    edge[M].next = head[v];
    head[v] = M++;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i]) s = i;
  }
  len = 0;
  dfs(s);
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    if (i != s && a[i]) {
      flag = false;
      break;
    }
  }
  if (!flag) {
    printf("-1\n");
  } else {
    printf("%d\n", len - a[s]);
    for (int i = a[s]; i < len; i++) {
      printf("%d ", path[i]);
    }
  }
  return 0;
}
