#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
vector<int> adj[MAX], tmp[MAX], answer;
int cur[MAX], cnt;
bool mark[MAX];
int get(int v) {
  mark[v] = true;
  int ret = cur[v];
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (!mark[u]) ret += get(u);
  }
  return ret;
}
void build(int v) {
  mark[v] = true;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (!mark[u]) {
      tmp[u].push_back(v);
      tmp[v].push_back(u);
      build(u);
    }
  }
}
void rev(int v) {
  answer.push_back(v);
  if (cur[v])
    cnt--;
  else
    cnt++;
  cur[v] ^= 1;
}
void dfs(int p, int v) {
  if (!cnt) throw 0;
  rev(v);
  for (int i = 0; i < adj[v].size(); i++) {
    if (!cnt) throw 0;
    int u = adj[v][i];
    if (u == p) continue;
    dfs(v, u);
    if (!cnt) throw 0;
    rev(v);
  }
  if (!cnt) throw 0;
  if (cur[v]) {
    rev(p);
    rev(v);
  }
  if (!cnt) throw 0;
}
int main() {
  ios::sync_with_stdio(false);
  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 >> cur[i];
    cnt += cur[i];
  }
  if (!cnt) {
    cout << 0 << endl;
    return 0;
  }
  int v = -1;
  for (int i = 1; i <= n; i++)
    if (!mark[i]) {
      int x = get(i);
      if (x == 0) continue;
      if (x != cnt) {
        cout << -1 << endl;
        return 0;
      }
      v = i;
    }
  memset(mark, false, sizeof(mark));
  build(v);
  for (int i = 1; i <= n; i++) adj[i] = tmp[i];
  try {
    dfs(0, v);
  } catch (...) {
    cout << answer.size() << endl;
    for (int i = 0; i < answer.size(); i++) cout << answer[i] << " ";
    cout << endl;
    return 0;
  }
  cout << -1 << endl;
  return 0;
}
