#include <bits/stdc++.h>
using namespace std;
struct qqq {
  int y, next;
} a[200010];
int n, m, K, bj, h[200010], b[200010], root, d[200010];
bool v[200010];
vector<int> c[200010], an;
void add(int x, int y) {
  K++;
  a[K].y = y, a[K].next = h[x], h[x] = K;
}
int read() {
  int sum = 0, f = 1;
  char st = getchar();
  while (st < '0' || st > '9') {
    if (st == '-') f = -1;
    st = getchar();
  }
  while ('0' <= st && st <= '9') {
    sum = (sum << 3) + (sum << 1) + st - '0';
    st = getchar();
  }
  return sum * f;
}
void sous(int x) {
  v[x] = 1;
  d[x] = b[x];
  for (int i = h[x]; i; i = a[i].next) {
    int y = a[i].y;
    if (v[y]) continue;
    sous(y);
    d[x] = d[x] | d[y];
    c[x].push_back(y);
    c[y].push_back(x);
  }
}
void chuli(int x, int fa) {
  an.push_back(x), b[x] ^= 1;
  for (int i = 0; i < c[x].size(); i++) {
    int y = c[x][i];
    if (y == fa || d[y] == 0) continue;
    chuli(y, x);
    an.push_back(x);
    b[x] ^= 1;
    if (b[y]) {
      b[y] = 0, b[x] ^= 1;
      an.push_back(y);
      an.push_back(x);
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    add(x, y);
    add(y, x);
  }
  for (int i = 1; i <= n; i++) {
    b[i] = read();
  }
  int st = 0;
  for (int i = 1; i <= n; i++) {
    if (!v[i]) {
      sous(i);
      if (d[i]) st++, root = i;
    }
  }
  if (st > 1) {
    puts("-1");
    return 0;
  }
  if (st == 0) {
    puts("0");
    return 0;
  }
  chuli(root, 0);
  if (b[root]) {
    an.push_back(c[root][0]);
    an.push_back(root);
    an.push_back(c[root][0]);
  }
  cout << an.size() << endl;
  for (int i = 0; i < an.size(); i++) {
    printf("%d ", an[i]);
  }
  return 0;
}
