#include <bits/stdc++.h>
using namespace std;
class TaskE {
  int n, m;
  vector<int> res, x;
  vector<bool> v;
  vector<vector<int>> g;
  void dfs(int u, int p) {
    v[u] = true;
    res.emplace_back(u);
    x[u] ^= true;
    for (auto &k : g[u]) {
      if (!v[k]) {
        dfs(k, u);
        res.emplace_back(u);
        x[u] ^= true;
      }
    }
    if (x[u]) {
      if (p != -1) {
        res.emplace_back(p);
        x[p] ^= true;
        res.emplace_back(u);
        x[u] ^= true;
      } else {
        res.pop_back();
        x[u] ^= true;
      }
    }
  }

 public:
  TaskE(int n, int m) {
    this->n = n;
    this->m = m;
    x.resize(n);
    g.resize(n);
    v.assign(n, false);
    for (int i = 0; i < m; i++) {
      int u, v;
      cin >> u >> v;
      u--, v--;
      g[u].emplace_back(v);
      g[v].emplace_back(u);
    }
    for (int i = 0; i < n; i++) {
      cin >> x[i];
    }
  }
  void solve() {
    if (count(x.begin(), x.end(), 1) == 0) {
      cout << 0 << '\n';
      return;
    }
    for (int i = 0; i < n; i++) {
      if (x[i]) {
        dfs(i, -1);
        break;
      }
    }
    for (int i = 0; i < n; i++) {
      if (!v[i] and x[i]) {
        cout << -1 << '\n';
        return;
      }
    }
    cout << res.size() << '\n';
    for (auto u : res) {
      cout << ++u << ' ';
    }
    cout << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  TaskE E(n, m);
  E.solve();
}
