#include <bits/stdc++.h>
using namespace std;
int INT_MAX_VAL = (int)1e20;
int INT_MIN_VAL = (int)-1e20;
long long LONG_MAX_VAL = (long long)1e20;
long long LONG_MIN_VAL = (long long)-1e20;
long long n, m, a, b;
vector<vector<long long> > g;
long long odd[100005];
bool used[100005];
vector<long long> path;
void add_to_path(long long v) {
  path.push_back(v);
  odd[v] = 1 - odd[v];
}
void dfs(long long v, long long p = -1) {
  used[v] = true;
  add_to_path(v);
  for (long long(i) = 0LL; (i) < (g[v].size()); (i)++) {
    long long w = g[v][i];
    if (!used[w]) {
      dfs(w, v);
      add_to_path(v);
    }
  }
  if (odd[v] == 1 && p != -1) {
    add_to_path(p);
    add_to_path(v);
  }
}
int main() {
  cin >> n >> m;
  g.resize(n + 1);
  for (long long(i) = 0LL; (i) < (m); (i)++) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (long long(i) = 0LL; (i) < (n); (i)++) {
    cin >> odd[i + 1];
  }
  long long p = -1;
  for (int i = 1; i <= n; i++) {
    if (odd[i]) {
      dfs(i);
      p = i;
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!used[i] && odd[i] == 1) {
      cout << -1 << '\n';
      return 0;
    }
  }
  long long i = 0;
  if (odd[p] && p != -1) {
    cout << path.size() - 1 << '\n';
    i = 1;
  } else {
    cout << path.size() << '\n';
  }
  for (; i < path.size(); i++) {
    cout << path[i] << " ";
  }
  return 0;
}
