#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
vector<int> G[maxn];
int ans[4 * maxn], tot, st, a[maxn];
bool used[maxn];
int vis[maxn];
void dfs(int u, int p) {
  used[u] = true;
  ans[tot++] = u;
  vis[u] ^= 1;
  int la = G[u].size();
  for (int i = 0; i < la; i++)
    if (!used[G[u][i]]) {
      dfs(G[u][i], u);
      ans[tot++] = u;
      vis[u] ^= 1;
    }
  if (a[u] != vis[u] && p != -1) {
    ans[tot++] = p;
    ans[tot++] = u;
    vis[p] ^= 1;
    vis[u] ^= 1;
  }
}
int main() {
  int n, m, u, v;
  tot = 0, st = -1;
  memset(used, 0, sizeof(used));
  memset(vis, 0, sizeof(vis));
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] && st == -1) st = i;
  }
  if (st == -1)
    printf("0\n");
  else {
    dfs(st, -1);
    if (a[st] != vis[st]) {
      vis[st] ^= 1;
      tot--;
    }
    bool ok = true;
    for (int i = 1; i <= n; i++)
      if (a[i] != vis[i]) {
        ok = false;
        break;
      }
    if (ok) {
      printf("%d\n", tot);
      for (int i = 0; i < tot; i++)
        if (i)
          printf(" %d", ans[i]);
        else
          printf("%d", ans[i]);
      printf("\n");
    } else
      printf("-1\n");
  }
  return 0;
}
