#include <bits/stdc++.h>
const int MAX = 1e5 + 20;
using namespace std;
vector<int> adj[MAX], ph;
int num[MAX];
bool mark[MAX];
void dfs(int u, int b) {
  int l = adj[u].size();
  ph.push_back(u);
  num[u] = 1 - num[u];
  mark[u] = true;
  for (int i = 0; i < l; i++) {
    int v = adj[u][i];
    if (!mark[v] && v != b) {
      dfs(v, u);
      ph.push_back(u);
      num[u] = 1 - num[u];
    }
  }
  if (num[u] == 1 && b != -1) {
    num[u] = 1 - num[u];
    num[b] = 1 - num[b];
    ph.push_back(b);
    ph.push_back(u);
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int v, u;
    cin >> v >> u;
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
  for (int i = 1; i <= n; i++) cin >> num[i];
  int q = 1;
  for (int i = 1; i <= n; i++) {
    if (num[i] == 1) {
      q = i;
      break;
    }
  }
  memset(mark, 0, sizeof(mark));
  dfs(q, -1);
  if (num[q] == 1) ph.resize(ph.size() - 1);
  bool flag = false;
  for (int i = 1; i <= n; i++) {
    if (!mark[i] && num[i] == 1) {
      flag = true;
      break;
    }
  }
  if (flag)
    cout << "-1" << endl;
  else {
    cout << ph.size() << endl;
    for (int i = 0; i < ph.size(); i++) cout << ph[i] << " ";
    cout << endl;
  }
}
