#include <bits/stdc++.h>
using namespace std;
int countBits(long long mask) {
  int res = 0;
  while (mask) mask &= (mask - 1), ++res;
  return res;
}
string toString(long long n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
long long toNumber(string s) {
  stringstream ss;
  long long n;
  ss << s;
  ss >> n;
  return n;
}
bool parity[100001], visited[100001];
vector<vector<int> > adjList;
int n, m, a, b;
vector<int> path;
void rec(int node, int parent) {
  path.push_back(node);
  parity[node] = 1 - parity[node];
  visited[node] = true;
  for (int i = (int)(0), _m = (int)(adjList[node].size()); i < _m; ++i) {
    int nxt = adjList[node][i];
    if (!visited[nxt]) {
      rec(nxt, node);
      path.push_back(node);
      parity[node] = 1 - parity[node];
    }
  }
  if (parity[node] && parent != -1) {
    path.push_back(parent);
    path.push_back(node);
    parity[parent] = 1 - parity[parent];
    parity[node] = 0;
  }
}
int main() {
  while (cin >> n >> m) {
    adjList.clear();
    adjList.resize(n);
    path.clear();
    for (int i = (int)(0), _m = (int)(m); i < _m; ++i) {
      cin >> a >> b;
      adjList[a - 1].push_back(b - 1);
      adjList[b - 1].push_back(a - 1);
    }
    int start = 0;
    for (int i = (int)(0), _m = (int)(n); i < _m; ++i) {
      cin >> parity[i];
      if (parity[i]) start = i;
    }
    memset(visited, false, sizeof visited);
    rec(start, -1);
    for (int i = (int)(0), _m = (int)(n); i < _m; ++i)
      if (parity[i] && i != start) {
        cout << -1 << endl;
        goto end;
      }
    if (parity[start]) path.pop_back();
    cout << path.size() << endl;
    if (path.size()) cout << 1 + path[0];
    for (int i = (int)(1), _m = (int)(path.size()); i < _m; ++i)
      cout << ' ' << 1 + path[i];
    if (path.size()) cout << endl;
  end:;
  }
}
