#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
int n, m;
int h[100010], ver[200020], nxt[200020], tot;
int nl[100010];
int vis[100010];
int ans[400040], cnt;
int id;
void add(int x, int y) {
  ver[++tot] = y;
  nxt[tot] = h[x];
  h[x] = tot;
}
void dfs(int x) {
  ans[++cnt] = x;
  vis[x] = 1;
  nl[x] ^= 1;
  for (int i = h[x]; i != 0; i = nxt[i]) {
    if (vis[ver[i]] == 0) {
      dfs(ver[i]);
      nl[x] ^= 1;
      ans[++cnt] = x;
      if (nl[ver[i]] == 1) {
        nl[ver[i]] ^= 1;
        nl[x] ^= 1;
        ans[++cnt] = ver[i];
        ans[++cnt] = x;
      }
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a = read(), b = read();
    add(a, b);
    add(b, a);
  }
  for (int i = 1; i <= n; i++) {
    nl[i] = read();
    if (nl[i] == 1) id = i;
  }
  if (id != 0) {
    dfs(id);
    if (nl[id] == 1) {
      ans[++cnt] = ver[h[id]];
      ans[++cnt] = id;
      ans[++cnt] = ver[h[id]];
      nl[id] = 0;
    }
  }
  int pd = 0;
  for (int i = 1; i <= n; i++) {
    if (nl[i] != 0) pd = 1;
  }
  if (id == 0 || pd == 0) {
    cout << cnt << endl;
    for (int i = 1; i <= cnt; i++) {
      cout << ans[i] << " ";
    }
  } else
    cout << "-1" << endl;
  return 0;
}
