#include <bits/stdc++.h>
using namespace std;
vector<int> a[100001], res;
int fa[100001];
bool odd[100001], in[100001];
int root, n, m;
void enter() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (m); ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    a[u].push_back(v);
    a[v].push_back(u);
  }
  for (int i = (1); i <= (n); ++i) {
    int x;
    scanf("%d", &x);
    odd[i] = (x == 1);
  }
}
void dfs(int u) {
  res.push_back(u);
  in[u] = !in[u];
  if (a[u].size() == 0) return;
  for (int i = 0; i < (a[u].size()); ++i) {
    int v = a[u][i];
    if (fa[v] == 0) {
      fa[v] = u;
      dfs(v);
      res.push_back(u);
      in[u] = !in[u];
    }
  }
  if (in[u] != odd[u] && fa[u] != -1) {
    res.push_back(fa[u]);
    in[fa[u]] = !in[fa[u]];
    res.push_back(u);
    in[u] = !in[u];
  }
}
bool check() {
  memset(fa, 0, sizeof(fa));
  for (int i = (1); i <= (n); ++i)
    if (fa[i] == 0 && odd[i]) {
      root = i;
      fa[i] = -1;
      dfs(i);
      break;
    }
  for (int i = (1); i <= (n); ++i)
    if (odd[i] && fa[i] == 0) return 1;
  return 0;
}
int main() {
  enter();
  if (check())
    cout << -1;
  else {
    if (in[root] != odd[root]) res.pop_back();
    cout << res.size() << endl;
    for (int i = 0; i < (res.size()); ++i) printf("%d ", res[i]);
  }
}
