#include <bits/stdc++.h>
using namespace std;
const int N = 110000;
vector<int> e[N];
vector<int> ans;
int odd[N], vis[N], fa[N], now[N];
int _find(int x) {
  if (x == fa[x]) return x;
  return fa[x] = _find(fa[x]);
}
void _union(int x, int y) {
  int xx = _find(x), yy = _find(y);
  if (xx != yy) fa[xx] = yy;
}
void dfs(int u, int fa) {
  now[u] = 1;
  vis[u] = 1;
  ans.push_back(u);
  for (int i = 0; i < (int)e[u].size(); i++) {
    int t = e[u][i];
    if (vis[t]) continue;
    dfs(t, u);
    ans.push_back(u);
    now[u] ^= 1;
  }
  if (now[u] != odd[u] && fa != -1) {
    ans.push_back(fa);
    ans.push_back(u);
    now[fa] ^= 1;
  } else if (fa == -1 && now[u] != odd[u]) {
    ans.erase(ans.end() - 1);
  }
}
int f(int n) {
  for (int i = 1; i <= n; i++) {
    vis[_find(i)] |= odd[i];
  }
  int t = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i]) t++;
  }
  if (t > 1) return 1;
  return 0;
}
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    e[x].push_back(y), e[y].push_back(x);
    _union(x, y);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &odd[i]);
  if (f(n))
    printf("-1\n");
  else {
    memset(vis, 0, sizeof(vis));
    for (int i = 1; i <= n; i++) {
      if (odd[i]) {
        dfs(i, -1);
        break;
      }
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < (int)ans.size(); i++) printf("%d ", ans[i]);
  }
  return 0;
}
