#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N], cnt[N], mark[N];
vector<int> adj[N], vec;
void dfs(int v, int par) {
  mark[v] = 1;
  cnt[v]++;
  vec.push_back(v);
  for (auto u : adj[v]) {
    if (mark[u]) continue;
    dfs(u, v);
    cnt[v]++;
    vec.push_back(v);
  }
  if (a[v] % 2 == cnt[v] % 2) return;
  if (par != -1) {
    cnt[v]++;
    cnt[par]++;
    vec.push_back(par);
    vec.push_back(v);
  } else
    vec.pop_back();
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  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 >> a[i];
  bool f = 1;
  for (int i = 1; i <= n && f; i++)
    if (a[i]) dfs(i, -1), f = 0;
  for (int i = 1; i <= n; i++)
    if (!mark[i] && a[i]) return cout << -1, 0;
  cout << vec.size() << '\n';
  for (auto x : vec) cout << x << ' ';
  return 0;
}
