#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
struct node {
  int to, nxt;
} e[N];
int n, m, cnt = 0, ans, s, vis[N], road[N << 2];
int a[N], head[N];
void add(int u, int v) {
  e[++cnt].nxt = head[u];
  e[cnt].to = v;
  head[u] = cnt;
}
void dfs(int u, int fa) {
  vis[u] = 1;
  road[++ans] = u;
  a[u] ^= 1;
  for (int i = head[u]; i; i = e[i].nxt) {
    if (!vis[e[i].to]) {
      dfs(e[i].to, u);
      road[++ans] = u;
      a[u] ^= 1;
    }
  }
  if (a[u]) {
    road[++ans] = fa;
    a[fa] ^= 1;
    road[++ans] = u;
    a[u] ^= 1;
  }
}
int main() {
  cin >> n >> m;
  int u, v;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &u, &v);
    add(u, v);
    add(v, u);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i]) s = i;
  }
  if (s) dfs(s, -1);
  for (int i = 1; i <= n; i++)
    if (!vis[i] && a[i]) {
      cout << -1;
      return 0;
    }
  if (ans > 1 && road[ans - 1] == -1) ans -= 3;
  cout << ans << endl;
  for (int i = 1; i <= ans; i++) printf("%d ", road[i]);
  return 0;
}
