#include <bits/stdc++.h>
using namespace std;
const int maxn = 999999;
const int maxm = 999999;
struct Edge {
  int v, next;
} e[maxm];
int en;
int head[maxn];
void add(int x, int y) {
  e[en].v = y;
  e[en].next = head[x];
  head[x] = en++;
}
bool a[maxn];
int d[maxn];
int n, m;
int st, ed;
int vis[maxn];
vector<int> b;
void dfs(int x) {
  vis[x] = 1;
  b.push_back(x);
  for (int i = head[x]; i != -1; i = e[i].next) {
    if (!vis[e[i].v]) {
      dfs(e[i].v);
      b.push_back(x);
      vis[x]++;
      if (vis[e[i].v] % 2 != a[e[i].v]) {
        vis[e[i].v]++;
        vis[x]++;
        b.push_back(e[i].v);
        b.push_back(x);
      }
    }
  }
  return;
}
int farm() {
  int i;
  int st = -1;
  for (i = 1; i <= n; i++) {
    if (a[i] == 1) {
      st = i;
      break;
    }
  }
  if (st == -1) return 0;
  memset(vis, 0, sizeof(vis));
  b.clear();
  dfs(st);
  if (vis[st] % 2 != a[st]) {
    vis[st]--;
    b.erase(b.begin());
  }
  int maxi = b.size();
  for (i = 1; i <= n; i++)
    if (vis[i] % 2 != a[i]) return -1;
  return b.size();
}
int main() {
  int i, j, x, y;
  memset(head, -1, sizeof(head));
  en = 0;
  cin >> n >> m;
  memset(d, 0, sizeof(d));
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    add(x, y);
    add(y, x);
    d[x]++;
    d[y]++;
  }
  for (i = 1; i <= n; i++) cin >> a[i];
  int ans = farm();
  cout << ans << endl;
  if (ans != -1) {
    int maxi = b.size();
    if (maxi > 0) cout << b[0];
    for (i = 1; i < maxi; i++) cout << " " << b[i];
    puts("");
  }
}
