#include <bits/stdc++.h>
using namespace std;
long long int pw(long long int a, long long int b, long long int mod) {
  if (!b) return 1;
  if (b & 1) return a * pw(a * a % mod, b / 2, mod) % mod;
  return pw(a * a % mod, b / 2, mod) % mod;
}
const long long int MAXN = 1e5 + 10;
const long long int INF = 8e18;
const long long int MOD = 1e9 + 7;
int n, m, root, t[MAXN], z[MAXN];
vector<int> adj[MAXN], ans, g[MAXN];
bitset<MAXN> mark;
void preDFS(int u) {
  z[u] = t[u];
  mark[u] = true;
  for (int v : adj[u]) {
    if (mark[v]) continue;
    preDFS(v);
    z[u] |= z[v];
  }
}
void DFS(int u, int p = -1) {
  mark[u] = true;
  ans.push_back(u);
  int deg = 1;
  for (int v : adj[u]) {
    if (mark[v] || !z[v]) continue;
    DFS(v, u);
    ans.push_back(u);
    deg++;
    if (t[v] == 1) {
      ans.push_back(v);
      ans.push_back(u);
      t[v] = 0;
      deg++;
    }
  }
  t[u] ^= deg % 2;
  if (p == -1 && t[u]) {
    ans.push_back(adj[u][0]);
    ans.push_back(u);
    ans.push_back(adj[u][0]);
    t[u] = 0;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    if (t[i]) root = i;
  }
  if (root == 0) return cout << 0 << '\n', 0;
  ;
  preDFS(root);
  mark.reset();
  DFS(root);
  for (int i = 1; i <= n; i++) {
    if (t[i]) return cout << -1 << '\n', 0;
    ;
  }
  cout << ans.size() << '\n';
  for (int u : ans) {
    cout << u << ' ';
  }
  cout << '\n';
  return 0;
}
