#include <bits/stdc++.h>
using namespace std;
vector<int> g[100001];
bool visit[100001], x[100001];
int l[400001];
int n, m, u, v, s = -1, ans = 0;
bool judge() {
  for (int i = 1; i <= n; i++) {
    if (x[i]) return false;
  }
  return true;
}
void dfs(int k) {
  x[k] ^= 1;
  l[ans++] = k;
  visit[k] = 1;
  for (int i = 0; i < g[k].size(); i++) {
    if (visit[g[k][i]]) continue;
    dfs(g[k][i]);
    x[k] ^= 1;
    l[ans++] = k;
    if (x[g[k][i]]) {
      x[g[k][i]] ^= 1;
      l[ans++] = g[k][i];
      x[k] ^= 1;
      l[ans++] = k;
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    if (s < 0 && x[i]) s = i;
  }
  dfs(s);
  if (x[s]) {
    x[s] = 0;
    ans--;
  }
  if (judge()) {
    cout << ans << endl;
    if (ans) {
      cout << l[0];
      for (int i = 1; i < ans; i++) {
        cout << ' ' << l[i];
      }
      cout << endl;
    }
  } else
    cout << "-1" << endl;
  return 0;
}
