#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
vector<int> g[MAXN];
int v[MAXN], used[MAXN], prv[MAXN];
vector<int> ans;
void dfs(int s) {
  int i, to;
  used[s] = 1;
  v[s] ^= 1;
  ans.push_back(s);
  for (i = 0; i < (int)g[s].size(); i++) {
    to = g[s][i];
    if (!used[to]) {
      prv[to] = s;
      dfs(to);
      v[s] ^= 1;
      ans.push_back(s);
    }
  }
  if (v[s] && prv[s]) {
    v[s] ^= 1;
    v[prv[s]] ^= 1;
    ans.push_back(prv[s]);
    ans.push_back(s);
  }
}
void solve() {
  int n, m, a, b, i, s;
  scanf("%d%d", &n, &m);
  for (; m; m--) {
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  s = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &v[i]);
    if (v[i] == 1) {
      s = i;
    }
  }
  if (s == 0) {
    printf("0\n");
    return;
  }
  dfs(s);
  if (v[s]) {
    ans.pop_back();
    v[s] ^= 1;
  }
  for (i = 1; i <= n; i++) {
    if (v[i]) {
      printf("-1\n");
      return;
    }
  }
  printf("%d\n", (int)ans.size());
  for (i = 0; i < (int)ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  putchar('\n');
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
