#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5, inf = 1e9 + 7;
long long n, k, id = 0;
long long A[N], B[N], vis[N];
vector<long long> adj[N], v;
void dfs(long long id, long long p) {
  A[id] ^= 1;
  v.emplace_back(id);
  vis[id] = 1;
  for (auto i : adj[id])
    if (!vis[i]) {
      dfs(i, id);
      A[id] ^= 1;
      v.emplace_back(id);
    }
  if (A[id] != B[id]) {
    if (id == p) {
      long long a = adj[id][0];
      v.emplace_back(a);
      v.emplace_back(id);
      v.emplace_back(a);
      A[id] = B[id];
    } else {
      v.emplace_back(p);
      v.emplace_back(id);
      A[id] = B[id];
      A[p] ^= 1;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, a, b, c;
  cin >> n >> k;
  for (i = 0; i < k; i++) {
    cin >> a >> b;
    adj[a].emplace_back(b);
    adj[b].emplace_back(a);
  }
  for (i = 1; i < n + 1; i++) cin >> B[i];
  for (i = 1; i < n + 1; i++)
    if (!vis[i] && B[i]) {
      dfs(i, i);
      break;
    }
  for (i = 1; i < n + 1; i++)
    if (A[i] != B[i]) return cout << -1, 0;
  cout << (long long)v.size() << "\n";
  for (auto i : v) cout << i << " ";
}
