#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
vector<int> adj[maxn], pat;
bool mark[maxn];
int a[maxn], par[maxn], cur, cnt[maxn], one, tw;
void dfs1(int v) {
  mark[v] = 1;
  for (int u : adj[v]) {
    if (!mark[u]) {
      if (v == one) tw = u;
      par[u] = v;
      dfs1(u);
    }
  }
}
void go(int v) {
  cur = v;
  cnt[v] = 1 - cnt[v];
  pat.push_back(v);
}
void dfs(int v) {
  for (int u : adj[v]) {
    if (u == par[v]) continue;
    if (par[u] != v) continue;
    go(u);
    dfs(u);
  }
  if (v != par[v]) {
    if (cnt[v] == a[v])
      go(par[v]);
    else
      go(par[v]), go(v), go(par[v]);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < n; i++) random_shuffle(adj[i].begin(), adj[i].end());
  one = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i]) one = i;
  }
  if (one == -1) {
    cout << "0" << '\n';
    return 0;
  }
  dfs1(one);
  par[one] = one;
  for (int i = 0; i < n; i++)
    if (!mark[i] && a[i]) {
      cout << "-1" << '\n';
      return 0;
    }
  go(one);
  dfs(one);
  if (cnt[one] != a[one]) go(tw), go(one), go(tw);
  cout << pat.size() << '\n';
  for (int i : pat) cout << i + 1 << " ";
  cout << '\n';
}
