#include <bits/stdc++.h>
using namespace std;
inline void __CIN__() {
  ios::sync_with_stdio(false);
  cin.tie(0);
}
char buf;
inline int xint() {
  while (buf = getchar(), buf < '0' || buf > '9')
    ;
  int x = buf - '0';
  for (; buf = getchar(), buf >= '0' && buf <= '9'; x = x * 10 + buf - '0')
    ;
  return x;
}
inline long long xll() {
  while (buf = getchar(), buf < '0' || buf > '9')
    ;
  long long x = buf - '0';
  for (; buf = getchar(), buf >= '0' && buf <= '9'; x = x * 10 + buf - '0')
    ;
  return x;
}
inline string xstring() {
  while (buf = getchar(), buf == ' ' || buf == '\n')
    ;
  string x = "";
  for (x += buf; buf = getchar(), buf != ' ' && buf != '\n'; x += buf)
    ;
  return x;
}
const int MAXN = 1e5 + 5;
bool check[MAXN];
vector<int> edge[MAXN], ans;
int N, num[MAXN];
void dfs(int now, int pre) {
  check[now] = true;
  ans.push_back(now);
  num[now] ^= 1;
  for (auto nxt : edge[now])
    if (!check[nxt]) {
      dfs(nxt, now);
      ans.push_back(now);
      num[now] ^= 1;
    }
  if (num[now]) {
    if (pre == 0) {
      ans.pop_back();
    } else {
      ans.push_back(pre);
      num[pre] ^= 1;
      ans.push_back(now);
    }
    num[now] ^= 1;
  }
  return;
}
int main() {
  N = xint();
  for (int T = xint(); T--;) {
    int x = xint(), y = xint();
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  for (int i = 1; i <= N; ++i) num[i] = xint();
  for (int i = 1; i <= N; ++i)
    if (num[i]) {
      dfs(i, 0);
      break;
    }
  for (int i = 1; i <= N; ++i)
    if (num[i]) {
      printf("-1\n");
      return 0;
    }
  printf("%d\n", (int)ans.size());
  for (auto i : ans) printf("%d ", i);
  return 0;
}
