#include <bits/stdc++.h>
using namespace std;
namespace baseFastio {
template <typename Int>
inline Int read() {
  Int flag = 1;
  char c = getchar();
  while ((!isdigit(c)) && c != '-' && c != EOF) c = getchar();
  if (c == '-') flag = -1, c = getchar();
  Int init = c & 15;
  while (isdigit(c = getchar())) init = (init << 3) + (init << 1) + (c & 15);
  return init * flag;
}
template <typename Int>
inline Int read(char& c) {
  Int flag = 1;
  c = getchar();
  while ((!isdigit(c)) && c != '-' && c != EOF) c = getchar();
  if (c == '-') flag = -1, c = getchar();
  Int init = c & 15;
  while (isdigit(c = getchar())) init = (init << 3) + (init << 1) + (c & 15);
  return init * flag;
}
template <typename Int>
inline void write(Int x) {
  if (x < 0) putchar('-'), x = ~x + 1;
  if (x > 9) write(x / 10);
  putchar((x % 10) | 48);
}
template <typename Int>
inline void write(Int x, char nextch) {
  write(x);
  putchar(nextch);
}
}  // namespace baseFastio
namespace Fastio {
enum io_flags { ignore_int = 1 << 0 };
struct Reader {
  char endch;
  Reader() { endch = '\0'; }
  template <typename Int>
  Int operator()() {
    return baseFastio::read<Int>(endch);
    ;
  }
  Reader& operator>>(io_flags f) {
    if (f == ignore_int) baseFastio::read<int>();
    return *this;
  }
  template <typename Int>
  Reader& operator>>(Int& i) {
    i = baseFastio::read<Int>(endch);
    return *this;
  }
  template <typename Int>
  inline Int get_int() {
    return baseFastio::read<Int>();
  }
  inline char get_nxt() { return endch; }
} read;
struct Writer {
  Writer& operator<<(const char* ch) {
    while (*ch) putchar(*(ch++));
    return *this;
  }
  Writer& operator<<(const char ch) {
    putchar(ch);
    return *this;
  }
  template <typename Int>
  Writer& operator<<(const Int i) {
    baseFastio::write(i);
    return *this;
  }
} write;
}  // namespace Fastio
using namespace Fastio;
namespace against_cpp11 {
const int N = 1e5 + 7;
int n, m, x[N];
vector<int> G[N];
int seq[N * 4], seq_cnt;
int vis[N], have_1_x;
void dfs(int u) {
  if (x[u]) have_1_x = true;
  vis[u] = 1;
  ((x[u] = !x[u]), (seq[++seq_cnt] = (u)));
  for (size_t i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (vis[v]) continue;
    dfs(v);
    ((x[u] = !x[u]), (seq[++seq_cnt] = (u)));
    if (x[v]) {
      ((x[v] = !x[v]), (seq[++seq_cnt] = (v)));
      ((x[u] = !x[u]), (seq[++seq_cnt] = (u)));
    }
  }
}
void set_x_to_0(int u) {
  x[u] = 0;
  vis[u] = 2;
  for (size_t i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (vis[v] == 2) continue;
    set_x_to_0(v);
  }
}
signed main() {
  read >> n >> m;
  for (int i = 1, u, v; i <= m; i++) {
    read >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) read >> x[i];
  int root = 1;
  have_1_x = 0;
  while (root <= n) {
    if (!vis[root]) {
      dfs(root);
      if (have_1_x) break;
      set_x_to_0(root);
      seq_cnt = 0;
    }
    root++;
  }
  for (int i = 1; i <= n; i++)
    if (x[i] && i != root) {
      puts("-1");
      return 0;
    }
  int l = 1, r = seq_cnt;
  if (x[root] == 1) l = 2;
  while (l < r && seq[l] == seq[r]) l++, r--;
  write << r - l + 1 << '\n';
  for (int i = l; i <= r; i++) write << seq[i] << " \n"[i == r];
  return 0;
}
}  // namespace against_cpp11
signed main() { return against_cpp11::main(); }
