#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > A;
vector<int> X, visited, answer;
int CountOdd(int v) {
  int ret = X[v];
  visited[v] = true;
  for (int i = 0; i < A[v].size(); ++i) {
    int v2 = A[v][i];
    if (visited[v2]) continue;
    ret += CountOdd(v2);
  }
  return ret;
}
void Rec(int v, bool root) {
  visited[v] = true;
  for (int i = 0; i < A[v].size(); ++i) {
    int v2 = A[v][i];
    if (visited[v2]) continue;
    answer.push_back(v);
    X[v] = 1 - X[v];
    Rec(v2, false);
    if (X[v2] == 1) {
      answer.push_back(v);
      X[v] = 1 - X[v];
      answer.push_back(v2);
      X[v2] = 1 - X[v2];
    }
  }
  if (root == false || X[v] == 1) {
    answer.push_back(v);
    X[v] = 1 - X[v];
  }
}
int main() {
  int m;
  cin >> n >> m;
  A.assign(n, vector<int>());
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    A[u].push_back(v);
    A[v].push_back(u);
  }
  int total_odd = 0;
  X.assign(n, 0);
  for (int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    if (tmp != 0) X[i] = 1;
    if (X[i] == 1) ++total_odd;
  }
  if (total_odd == 0) {
    cout << 0;
    return 0;
  }
  visited.assign(n, 0);
  for (int i = 0; i < n; ++i)
    if (visited[i] == 0) {
      int tmp = CountOdd(i);
      if (tmp == total_odd) {
        visited.assign(n, 0);
        Rec(i, true);
        cout << answer.size() << endl;
        for (int j = 0; j < answer.size(); ++j) cout << answer[j] + 1 << " ";
        return 0;
      }
    }
  cout << -1;
  return 0;
}
