#include <bits/stdc++.h>
using namespace std;
vector<int> v[100005];
vector<int> p;
int x[100005];
bool mark[100005];
void push(int now) {
  p.push_back(now);
  x[now] ^= 1;
}
void dfs(int now) {
  mark[now] = true;
  push(now);
  for (int i = 0; i < v[now].size(); i++) {
    int y = v[now][i];
    if (!mark[y]) {
      dfs(y);
      push(now);
      if (x[y]) {
        push(y);
        push(now);
      }
    }
  }
}
int main() {
  int n, m, a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i <= n; i++)
    if (x[i] == 1) {
      dfs(i);
      if (x[i]) {
        push(v[i][0]);
        push(i);
        push(v[i][0]);
      }
      break;
    }
  for (int i = 1; i <= n; i++)
    if (x[i]) {
      cout << -1 << endl;
      return 0;
    }
  cout << p.size() << endl;
  for (int i = 0; i < p.size(); i++) cout << p[i] << ' ';
  cout << endl;
  return 0;
}
