#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
const int MOD = 1000000007;
int parity[MAXN], u[MAXN], possible[MAXN], times[MAXN];
vector<int> ans, g[MAXN];
int root(int a) { return u[a] == a ? a : u[a] = root(u[a]); }
void dfs(int a, int p) {
  times[a]++;
  ans.push_back(a);
  for (int i : g[a])
    if (i != p) {
      dfs(i, a);
      times[a]++;
      ans.push_back(a);
    }
  times[a] %= 2;
  if (times[a] != parity[a]) {
    if (p == 0) {
      ans.push_back(g[a][0]);
      ans.push_back(a);
      ans.push_back(g[a][0]);
    } else {
      ans.push_back(p);
      ans.push_back(a);
      times[p]++;
      times[a]++;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= n; i++) u[i] = i;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    if (root(a) != root(b)) {
      u[root(a)] = root(b);
      g[a].push_back(b);
      g[b].push_back(a);
    }
  }
  for (int i = 1; i <= n; i++) {
    cin >> parity[i];
    if (parity[i]) possible[root(i)] = 1;
  }
  int rt = -1;
  for (int i = 1; i <= n; i++)
    if (root(i) == i && possible[i]) {
      if (rt != -1) {
        cout << "-1\n";
        return 0;
      }
      rt = i;
    }
  if (rt == -1) {
    cout << "0\n";
    return 0;
  }
  dfs(rt, 0);
  cout << ans.size() << '\n';
  for (int i : ans) cout << i << ' ';
  cout << "\n";
  return 0;
}
