#include <bits/stdc++.h>
using namespace std;
int k, m, n, t, a[100001], f[100001], p[100001], qy[200001], qp[200001],
    w[500001];
bool v[100001];
void add(int x, int y) {
  k++;
  qy[k] = y;
  qp[k] = p[x];
  p[x] = k;
}
void rec(int x, int y) {
  t++;
  w[t] = x;
  f[x] ^= 1;
  v[x] = true;
  int g = p[x];
  while (g) {
    if (!v[qy[g]]) {
      rec(qy[g], x);
      t++;
      w[t] = x;
      f[x] ^= 1;
    }
    g = qp[g];
  }
  if (a[x] != f[x] && y > 0) {
    t++;
    w[t] = y;
    f[y] ^= 1;
    t++;
    w[t] = x;
    f[x] ^= 1;
  }
}
int main() {
  cin >> n >> m;
  k = t = 0;
  for (int i = 0; i <= n; i++) {
    f[i] = 0;
    p[i] = 0;
    v[i] = false;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    add(x, y);
    add(y, x);
  }
  for (int i = 1; i <= n; i++) cin >> a[i];
  int start = 1;
  for (int i = 1; i <= n; i++)
    if (a[i]) start = i;
  rec(start, -1);
  bool ok = true;
  for (int i = 1; i <= n; i++)
    if (a[i] && !v[i]) ok = false;
  if (!ok)
    cout << -1 << endl;
  else {
    if (a[start] != f[start]) t--;
    cout << t << endl;
    for (int i = 1; i <= t; i++) cout << w[i] << ' ';
    cout << endl;
  }
}
