#include <bits/stdc++.h>
using namespace std;
int n, m;
struct edge {
  int a, b;
} E[100001];
int F[100001];
int want[100001];
int f(int x) { return F[x] == x ? x : F[x] = f(F[x]); }
vector<int> e[100001];
int haveOdd[100001];
vector<int> ans;
void go(int cur, int from) {
  ans.push_back(cur);
  want[cur] ^= 1;
  for (int i = 0; i < e[cur].size(); i++) {
    int t = e[cur][i];
    if (t == from) continue;
    go(t, cur);
    ans.push_back(cur);
    want[cur] ^= 1;
    if (want[t] == 1) {
      ans.push_back(t);
      want[t] ^= 1;
      ans.push_back(cur);
      want[cur] ^= 1;
    }
  }
}
int MAIN() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> E[i].a >> E[i].b;
  for (int i = 1; i <= n; i++) {
    cin >> want[i];
    F[i] = i;
  }
  for (int i = 1; i <= m; i++) {
    int fa = f(E[i].a), fb = f(E[i].b);
    if (fa != fb) {
      e[E[i].a].push_back(E[i].b);
      e[E[i].b].push_back(E[i].a);
      F[fa] = fb;
    }
  }
  memset(haveOdd, 0, sizeof(haveOdd));
  for (int i = 1; i <= n; i++)
    if (want[i] == 1) haveOdd[f(i)] = 1;
  int nHaveOdd = 0, whichHaveOdd = 0;
  for (int i = 1; i <= n; i++)
    if (haveOdd[i]) {
      nHaveOdd++;
      whichHaveOdd = i;
    }
  if (nHaveOdd == 0) {
    cout << 0 << endl;
  } else if (nHaveOdd > 1) {
    cout << -1 << endl;
  } else {
    go(whichHaveOdd, -1);
    int start = 0;
    if (want[whichHaveOdd] == 1) start = 1;
    cout << ans.size() - start << endl;
    for (int i = start; i < ans.size(); i++)
      cout << ans[i] << (i == ans.size() - 1 ? "\n" : " ");
  }
  return 0;
}
int main() {
  ios ::sync_with_stdio(false);
  cout << fixed << setprecision(16);
  return MAIN();
}
