#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
vector<int> a[MAXN], b[MAXN], ans;
int mark[MAXN];
bool vis[MAXN];
bool barg[MAXN];
int cnt[MAXN], d[MAXN];
int root;
void dfs1(int v) {
  vis[v] = true;
  if (mark[v]) cnt[v]++;
  for (int i = 0; i < b[v].size(); i++)
    if (vis[b[v][i]] == false) {
      dfs1(b[v][i]);
      if (cnt[b[v][i]] > 0) {
        a[b[v][i]].push_back(v);
        a[v].push_back(b[v][i]);
        cnt[v] += cnt[b[v][i]];
      }
    }
}
void dfs2(int v) {
  vis[v] = true;
  int t = 1;
  ans.push_back(v);
  for (int i = 0; i < a[v].size(); i++) {
    if (i == a[v].size() - 1 and v == root) {
      dfs2(a[v][i]);
      if (d[a[v][i]] == 1) {
        ans.push_back(v);
        t++;
        ans.push_back(a[v][i]);
        if (t % 2 != mark[v]) ans.push_back(v);
      } else {
        if (t % 2 != mark[v]) ans.push_back(v), t++;
      }
    }
    if (vis[a[v][i]] == false) {
      dfs2(a[v][i]);
      ans.push_back(v);
      t++;
      if (d[a[v][i]] == 1) {
        ans.push_back(a[v][i]);
        ans.push_back(v);
        t++;
      }
    }
  }
  if (t % 2 != mark[v]) d[v] = 1;
}
int main() {
  int n, m;
  cin >> n >> m;
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    b[x].push_back(y);
    b[y].push_back(x);
  }
  int ziro = 0;
  for (int i = 0; i < n; i++) {
    cin >> mark[i + 1];
    if (mark[i + 1] == 1) ziro++;
  }
  if (ziro == 0) {
    cout << 0;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (mark[i + 1]) {
      int v = i + 1;
      root = v;
      dfs1(v);
      for (int i = 1; i <= n; i++) vis[i] = false;
      dfs2(v);
      break;
    }
  }
  bool impossible = false;
  for (int i = 1; i <= n; i++)
    if (mark[i] == true)
      if (vis[i] == false) impossible = true;
  if (impossible) {
    cout << -1;
    return 0;
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
  return 0;
}
