#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
vector<int> adj[N], ret;
bool vis[N];
int x[N], cc[N];
void dfs(int ind, int p) {
  int i, a;
  vis[ind] = 1;
  cc[ind]++;
  ret.push_back(ind);
  for (i = 0; i < adj[ind].size(); ++i) {
    a = adj[ind][i];
    if (!vis[a]) {
      dfs(a, ind);
      ret.push_back(ind);
      cc[ind]++;
    }
  }
  if ((x[ind] ^ cc[ind]) & 1 && p != -1) {
    ret.push_back(p);
    ret.push_back(ind);
    cc[p]++;
    cc[ind]++;
  }
}
int main() {
  int n, m, a, b, i, j;
  cin >> n >> m;
  for (i = 0; i < m; ++i) {
    scanf("%d%d", &a, &b);
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int r = 0;
  for (i = 1; i <= n; ++i) {
    cin >> x[i];
    if (x[i]) r = i;
  }
  if (r)
    dfs(r, -1);
  else {
    printf("0\n");
    return 0;
  }
  r = ret.back();
  if ((x[r] ^ cc[r]) & 1) ret.pop_back(), cc[r]--;
  for (i = 1; i <= n; ++i)
    if ((x[i] ^ cc[i]) & 1) {
      printf("-1\n");
      return 0;
    }
  cout << ret.size() << endl;
  for (i = 0; i < ret.size(); ++i) printf("%d ", ret[i]);
  putchar('\n');
}
