#include <bits/stdc++.h>
using namespace std;
const long long Maxn = 1e5 + 3;
long long x[Maxn];
vector<long long> V[Maxn], ans;
bool mark[Maxn];
void dfs(long long u) {
  mark[u] = true;
  ans.push_back(u);
  x[u] = !x[u];
  for (long long i = 0; i < V[u].size(); i++) {
    long long v = V[u][i];
    if (!mark[v]) {
      dfs(v);
      ans.push_back(u);
      x[u] = !x[u];
      if (x[v]) {
        ans.push_back(v), ans.push_back(u);
        x[v] = !x[v];
        x[u] = !x[u];
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long u, v;
    cin >> u >> v;
    V[u].push_back(v);
    V[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) cin >> x[i];
  long long T = 0;
  for (long long i = 1; i <= n; i++)
    if (x[i]) T = i;
  if (T) {
    dfs(T);
    if (x[T] && V[T].size()) {
      ans.push_back(V[T][0]);
      ans.push_back(T);
      ans.push_back(V[T][0]);
    }
    x[T] = 0;
    for (int i = 1; i <= n; i++)
      if (x[i]) {
        cout << -1 << endl;
        return 0;
      }
  }
  cout << ans.size() << endl;
  for (long long i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
