#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
vector<int> G[maxn], ans;
int n, m, cnt[maxn], a, b, start;
bool vis[maxn];
inline int read() {
  int x = 0, f = 1;
  char ch = 0;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - 48;
  return x * f;
}
void dfs(int u) {
  vis[u] = 1;
  cnt[u] ^= 1;
  ans.push_back(u);
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    if (vis[v]) continue;
    dfs(v);
    ans.push_back(u);
    cnt[u] ^= 1;
    if (cnt[v] == 1)
      ans.push_back(v), cnt[v] ^= 1, ans.push_back(u), cnt[u] ^= 1;
  }
  if (u == start && cnt[u] == 1) cnt[u] ^= 1, ans.pop_back();
}
int main() {
  n = read();
  m = read();
  for (int i = 0; i < m; ++i) {
    int p = read(), q = read();
    G[p].push_back(q), G[q].push_back(p);
  }
  for (int i = 1; i <= n; ++i) cnt[i] = read(), start = (cnt[i]) ? i : start;
  dfs(start);
  for (int i = 1; i <= n; ++i)
    if (cnt[i]) {
      return puts("-1"), 0;
    }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) printf("%d ", ans[i]);
  putchar('\n');
}
