#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;
int a[N];
vector<int> g[N];
bool used[N];
int sz[N];
vector<int> order;
vector<int> out;
int init(int u) {
  used[u] = true;
  order.push_back(u);
  sz[u] = 0;
  for (int v : g[u])
    if (!used[v]) sz[u] += init(v);
  return sz[u] + a[u];
}
void dfs(int u, int s) {
  used[u] = true;
  out.push_back(u);
  a[u] ^= 1;
  for (int v : g[u])
    if (!used[v]) {
      if (sz[v] > 0) {
        dfs(v, s);
        out.push_back(u);
        a[u] ^= 1;
      }
      if (a[v] == 1) {
        out.push_back(v);
        a[v] ^= 1;
        out.push_back(u);
        a[u] ^= 1;
      }
      assert(a[v] == 0);
    }
  if (a[u] == 1 && u == s) {
    int v = g[u][0];
    out.push_back(v);
    a[v] ^= 1;
    out.push_back(u);
    a[u] ^= 1;
    out.push_back(v);
    a[v] ^= 1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < n; i++) cin >> a[i];
  int cnt = 0;
  for (int i = 0; i < n; i++)
    if (!used[i])
      if (init(i)) {
        cnt++;
        if (cnt > 1) break;
        for (int u : order) used[u] = false;
        dfs(i, i);
        for (int u : order) {
          used[u] = true;
        }
        order.clear();
      }
  if (cnt > 1) {
    cout << -1 << "\n";
    return 0;
  }
  cout << (int)out.size() << "\n";
  for (int i : out) cout << i + 1 << " ";
  cout << "\n";
  return 0;
}
