#include <bits/stdc++.h>
using namespace std;
vector<int> e[100005], ans;
int val[100005], r;
int c[100005];
bool visit[100005];
void dfs(int a) {
  visit[a] = true;
  ans.push_back(a);
  c[a]++;
  for (int i = 0; i < e[a].size(); i++) {
    int v = e[a][i];
    if (!visit[v]) {
      dfs(v);
      ans.push_back(a);
      c[a]++;
      if (c[v] % 2 != val[v]) {
        ans.push_back(v);
        ans.push_back(a);
        c[a]++;
        c[v]++;
      }
    }
  }
}
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 0; i < m; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      e[u].push_back(v);
      e[v].push_back(u);
    }
    r = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &val[i]);
      if (val[i] == 1) {
        r = i;
      }
    }
    if (val[r])
      dfs(r);
    else {
      cout << 0 << endl;
      return 0;
    }
    if (c[r] % 2 != val[r]) {
      if (e[r].size()) {
        c[r]++;
        ans.push_back(e[r][0]);
        ans.push_back(r);
        ans.push_back(e[r][0]);
      }
    }
    for (int i = 1; i <= n; i++) {
      if (c[i] % 2 != val[i]) {
        cout << -1 << endl;
        return 0;
      }
    }
    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
