#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
struct edge {
  int to, next;
} e[maxn << 1];
int n, m, len, tot, head[maxn], c[maxn], ans[maxn << 2];
bool f[maxn];
void insert(int x, int y) {
  e[++len].to = y;
  e[len].next = head[x];
  head[x] = len;
}
void dfs(int x) {
  c[x] = !c[x];
  ans[++tot] = x;
  f[x] = 1;
  for (int i = head[x]; i; i = e[i].next) {
    int k = e[i].to;
    if (!f[k]) {
      dfs(k);
      c[x] = !c[x];
      ans[++tot] = x;
      if (c[k]) {
        c[k] = !c[k];
        ans[++tot] = k;
        c[x] = !c[x];
        ans[++tot] = x;
      }
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, x, y; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    insert(x, y);
    insert(y, x);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &c[i]);
  }
  for (int i = 1; i <= n; ++i) {
    if (c[i] == 1) {
      dfs(i);
      if (c[i]) {
        tot--;
        c[i] = 0;
      }
      break;
    }
  }
  bool ff = 0;
  for (int i = 1; i <= n; ++i) {
    if (c[i]) {
      ff = 1;
      break;
    }
  }
  if (ff)
    printf("-1\n");
  else {
    printf("%d\n", tot);
    for (int i = 1; i <= tot; ++i) printf("%d ", ans[i]);
  }
  return 0;
}
