#include <bits/stdc++.h>
const int n = 100005;
int N, M, Cnt, X, Y, e, root;
int Road[4 * n], v[n], A[n], son[n], next[2 * n], ed[2 * n];
void Addedge(int i, int j) { ed[++e] = j, next[e] = son[i], son[i] = e; }
void dfs(int x, int p) {
  v[x] = 1, Road[++Cnt] = x, A[x] ^= 1;
  for (int i = son[x]; i; i = next[i])
    if (!v[ed[i]]) {
      dfs(ed[i], x);
      Road[++Cnt] = x, A[x] ^= 1;
    }
  if (A[x] && p) {
    Road[++Cnt] = p, A[p] ^= 1;
    Road[++Cnt] = x, A[x] ^= 1;
  }
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= M; ++i) {
    scanf("%d%d", &X, &Y);
    Addedge(X, Y), Addedge(Y, X);
  }
  for (int i = 1; i <= N; ++i) scanf("%d", &A[i]);
  for (int i = 1; i <= N; ++i)
    if (A[i]) {
      root = i;
      break;
    }
  if (!root) {
    printf("0\n");
    return 0;
  }
  dfs(root, 0);
  if (A[root]) --Cnt, A[root] ^= 1;
  for (int i = 1; i <= N; ++i)
    if (A[i]) {
      printf("-1\n");
      return 0;
    }
  printf("%d\n", Cnt);
  if (!Cnt) return 0;
  for (int i = 1; i < Cnt; ++i) printf("%d ", Road[i]);
  printf("%d\n", Road[Cnt]);
  return 0;
}
