#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
struct node {
  int to, next;
} a[N << 1];
int n, m, tot, w[N], ls[N], v[N];
queue<int> q;
bool flag;
void addl(int x, int y) {
  a[++tot].to = y;
  a[tot].next = ls[x];
  ls[x] = tot;
  return;
}
void dfs(int x) {
  v[x] = 1;
  flag |= w[x];
  for (int i = ls[x]; i; i = a[i].next)
    if (!v[a[i].to]) dfs(a[i].to);
  return;
}
void solve(int x) {
  q.push(x);
  w[x] ^= 1;
  v[x] = 1;
  for (int i = ls[x]; i; i = a[i].next) {
    int y = a[i].to;
    if (v[y]) continue;
    solve(y);
    if (w[y]) {
      q.push(x);
      q.push(y);
      w[x] ^= 1;
    }
    q.push(x);
    w[x] ^= 1;
  }
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    addl(x, y);
    addl(y, x);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &w[i]);
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (v[i]) continue;
    flag = 0;
    dfs(i);
    cnt += flag;
  }
  if (cnt > 1) return puts("-1") & 0;
  memset(v, 0, sizeof(v));
  for (int i = 1; i <= n; i++) {
    if (!w[i]) continue;
    solve(i);
    int l = q.size();
    if (w[i]) l--;
    printf("%d\n", l);
    while (l) {
      printf("%d ", q.front());
      l--;
      q.pop();
    }
    return 0;
  }
  printf("0\n");
  return 0;
}
