#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
vector<int> v[MAXN];
int p[MAXN];
bool mark[MAXN];
int tmp;
int cnt[MAXN];
int indexi[MAXN];
int d[MAXN];
vector<int> path;
void DFS(int x) {
  if (p[x] == 1) {
    cnt[tmp]++;
  }
  mark[x] = true;
  for (int i = 0; i < v[x].size(); i++) {
    int child = v[x][i];
    if (!mark[child]) {
      DFS(child);
    }
  }
}
void DFS2(int par, int x) {
  mark[x] = true;
  d[x]++;
  path.push_back(x);
  for (int i = 0; i < v[x].size(); i++) {
    int child = v[x][i];
    if (!mark[child]) {
      DFS2(x, child);
    }
  }
  if (par == 0) {
    return;
  }
  if (d[x] % 2 == p[x]) {
    d[par]++;
    path.push_back(par);
  }
  if (d[x] % 2 != p[x]) {
    d[par] += 2;
    d[x]++;
    path.push_back(par);
    path.push_back(x);
    path.push_back(par);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0, s, e; i < m; i++) {
    cin >> s >> e;
    v[s].push_back(e);
    v[e].push_back(s);
  }
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
  }
  tmp = 0;
  for (int i = 1; i <= n; i++) {
    if (mark[i] == false) {
      DFS(i);
      indexi[tmp] = i;
      tmp++;
    }
  }
  int cur = 0;
  int ind = 0;
  for (int i = 0; i < tmp; i++) {
    if (cnt[i] >= 1) {
      cur++;
      ind = i;
    }
  }
  if (cur > 1) {
    return cout << -1 << endl, 0;
  }
  if (cur == 0) {
    return cout << 0 << endl, 0;
  }
  int now = indexi[ind];
  for (int i = 1; i <= n; i++) {
    mark[i] = false;
  }
  DFS2(0, now);
  if (d[now] % 2 == p[now]) {
    cout << path.size() << endl;
    for (int i = 0; i < path.size(); i++) {
      cout << path[i] << ' ';
    }
    cout << endl;
    return 0;
  }
  int here = v[now][0];
  path.push_back(here);
  path.push_back(now);
  path.push_back(here);
  cout << path.size() << endl;
  for (int i = 0; i < path.size(); i++) {
    cout << path[i] << ' ';
  }
  cout << endl;
  return 0;
}
