#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const long long linf = 1ll << 60;
const double dinf = 1e60;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
template <typename T1, typename T2, typename T3, typename T4>
void scf(T1 &x, T2 &y, T3 &z, T4 &w) {
  scf(x);
  scf(y);
  scf(z);
  return scf(w);
}
inline char mygetchar() {
  char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
template <typename T>
void chkmax(T &x, const T &y) {
  if (y > x) x = y;
  return;
}
template <typename T>
void chkmin(T &x, const T &y) {
  if (y < x) x = y;
  return;
}
const int N = 1e5 + 100;
int n, m;
vector<int> g[N];
int par[N], x[N];
vector<int> all;
bool f[N];
int F(int u) { return u == par[u] ? u : par[u] = F(par[u]); }
void UN(int u, int v) {
  par[F(u)] = F(v);
  g[u].push_back(v);
  g[v].push_back(u);
  return;
}
void TZL() {
  scf(n, m);
  for (int i = (1); i <= (n); ++i) par[i] = i;
  for (int i = 0; i < (m); ++i) {
    int u, v;
    scf(u, v);
    if (F(u) != F(v)) UN(u, v);
  }
  for (int i = (1); i <= (n); ++i) scf(x[i]), f[F(i)] |= x[i];
  for (int i = (1); i <= (n); ++i)
    if (F(i) == i && f[i]) all.push_back(i);
  return;
}
vector<int> ans;
void dfs(int u, int fa = 0) {
  x[u] ^= 1;
  ans.push_back(u);
  for (int v : g[u])
    if (v != fa) {
      dfs(v, u);
      x[u] ^= 1;
      ans.push_back(u);
    }
  if (x[u]) {
    if (fa)
      ans.push_back(fa), ans.push_back(u), x[fa] ^= 1, x[u] ^= 1;
    else
      ans.pop_back();
  }
  return;
}
void RANK1() {
  if (!(int)all.size()) {
    puts("0\n");
    return;
  }
  if ((int)all.size() > 1) {
    puts("-1");
    return;
  }
  dfs(all[0]);
  printf("%d\n", (int)ans.size());
  for (int u : ans) printf("%d ", u);
  return;
}
int main() {
  TZL();
  RANK1();
  return 0;
}
