#include <bits/stdc++.h>
using namespace std;
const int MAX = 100020;
int n, m, parity[MAX];
vector<int> to[MAX];
void input() {
  scanf("%d%d", &n, &m);
  int i;
  for (i = 0; i < m; i++) {
    int f, s;
    scanf("%d%d", &f, &s);
    to[f].push_back(s);
    to[s].push_back(f);
  }
  for (i = 1; i <= n; i++) scanf("%d", &parity[i]);
}
vector<int> res;
bool visited[MAX];
void flip(int num) {
  res.push_back(num);
  parity[num] ^= 1;
}
void dfs(int now, int from) {
  visited[now] = 1;
  flip(now);
  int i;
  for (i = 0; i < to[now].size(); i++) {
    int next = to[now][i];
    if (next != from && !visited[next]) {
      dfs(next, now);
      flip(now);
      if (parity[next]) {
        flip(next);
        flip(now);
      }
    }
  }
  if (parity[now] && from == 0 && to[now].size() > 0) {
    int next = to[now][0];
    flip(next);
    flip(now);
    flip(next);
  }
}
void solve() {
  int i;
  for (i = 1; i <= n; i++) {
    if (parity[i]) {
      dfs(i, 0);
      return;
    }
  }
}
bool valid() {
  int i;
  for (i = 1; i <= n; i++) {
    if (parity[i]) return 0;
  }
  return 1;
}
void print() {
  printf("%d\n", res.size());
  int i;
  for (i = 0; i < res.size(); i++) printf("%d ", res[i]);
  puts("");
}
int main() {
  input();
  solve();
  if (valid())
    print();
  else
    puts("-1");
  return 0;
}
