#include <bits/stdc++.h>
using namespace std;
int n, m, top, cnt, to[4000001], nxt[4000001], f[200001], vis[200001],
    father[200001], od[200001], ans[1000001];
inline void add(int x, int y) {
  to[++cnt] = y;
  nxt[cnt] = f[x];
  f[x] = cnt;
}
inline void change(int poi) {
  ans[++top] = poi;
  vis[poi] = 1;
  od[poi] ^= 1;
}
inline void dfs(int poi) {
  change(poi);
  bool flag = 0;
  for (int i = f[poi]; i; i = nxt[i]) {
    int t = to[i];
    if (!vis[t]) {
      flag = 1;
      father[t] = poi;
      dfs(t);
      change(poi);
    }
  }
  if (od[poi]) {
    change(father[poi]);
    change(poi);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &od[i]);
  int poi = -1;
  for (int i = 1; i <= n; i++) {
    if (od[i]) {
      poi = i, father[poi] = -1, dfs(poi);
      break;
    }
  }
  if (poi == -1) {
    cout << '0' << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i] && od[i]) {
      cout << "-1" << endl;
      return 0;
    }
  if (ans[top - 1] == -1) top -= 3;
  printf("%d\n", top);
  for (int i = 1; i <= top; i++) printf("%d ", ans[i]);
}
