#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:666000000")
using namespace std;
const int INF = (1 << 30) - 1;
const long double EPS = 1e-9;
void ML(const bool v) {
  if (v) return;
  int *ass;
  for (;;) {
    ass = new int[2500000];
    for (int i = 0; i < 2500000; i++) ass[i] = rand();
  }
}
void TL(const bool v) {
  if (v) return;
  int *ass;
  ass = new int[250];
  for (;;) {
    for (int i = 0; i < 250; i++) ass[i] = rand();
  }
}
void PE(const bool v) {
  if (v) return;
  puts("ass 1 2 3 4 5 6 fuck");
  exit(0);
}
const int SZ = 100500;
vector<vector<int> > a;
int n;
int od[SZ];
void LoAd() {
  int m;
  cin >> n >> m;
  a.resize(n + 1);
  for (int f, t, i = 0; i < m; i++) {
    scanf("%d%d", &f, &t);
    a[f].push_back(t);
    a[t].push_back(f);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &od[i]);
}
bool was[SZ];
int dfs1(const int v) {
  if (was[v]) return 0;
  was[v] = true;
  int res = 0;
  for (auto it = a[v].begin(); it != a[v].end(); it++) res += dfs1(*it);
  return res + od[v];
}
vector<int> path;
int cnt[SZ];
void add(const int v) {
  cnt[v]++;
  path.push_back(v);
}
void dfs(const int v, const int p) {
  add(v);
  for (auto it = a[v].begin(); it != a[v].end(); it++) {
    if (0 == cnt[*it]) {
      dfs(*it, v);
      add(v);
    }
  }
  if (od[v] != cnt[v] % 2 && 0 != p) {
    add(p);
    add(v);
  }
}
void SoLvE() {
  for (int cc = 0, i = 1; i <= n; i++) {
    if (dfs1(i) > 0) cc++;
    if (cc > 1) {
      puts("-1");
      return;
    }
  }
  for (int i = 1; i <= n; i++)
    if (1 == od[i]) {
      dfs(i, 0);
      if (!path.empty() && od[i] != cnt[i] % 2) {
        path.pop_back();
        cnt[i]--;
      }
      printf("%d\n", (int)path.size());
      for (auto it = path.begin(); it != path.end(); it++) printf("%d ", *it);
      return;
    }
  puts("0");
}
int main() {
  srand((int)time(NULL));
  LoAd();
  SoLvE();
  return 0;
}
