#include <bits/stdc++.h>
using namespace std;
const int nmax = 110000;
int n, m;
int k;
list<int> graph[nmax];
bool visited[nmax];
int path[4 * nmax];
int component[nmax];
bool has_one[nmax];
int d[nmax];
void comp(int u, int num) {
  if (component[u] >= 0) return;
  if (d[u] % 2 == 1) has_one[num] = true;
  component[u] = num;
  for (list<int>::iterator iter = graph[u].begin(); iter != graph[u].end();
       ++iter) {
    comp(*iter, num);
  }
}
void dfs(int u, int parent, int* parent_visits) {
  visited[u] = true;
  int visits = 1;
  path[k++] = u;
  for (list<int>::iterator iter = graph[u].begin(); iter != graph[u].end();
       ++iter) {
    int v = *iter;
    if (v == parent) continue;
    if (visited[v]) continue;
    dfs(v, u, &visits);
    ++visits;
    path[k++] = u;
  }
  if (visits % 2 != d[u] % 2) {
    if (parent >= 0) {
      path[k++] = parent;
      path[k++] = u;
      ++*parent_visits;
    } else {
      --k;
    }
  }
}
int main() {
  memset(visited, 0, sizeof(visited));
  memset(component, -1, sizeof(component));
  memset(has_one, 0, sizeof(has_one));
  scanf("%d %d", &n, &m);
  k = 0;
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    --u;
    --v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &d[i]);
  }
  int num_comp = 0;
  for (int i = 0; i < n; ++i) {
    if (component[i] >= 0) continue;
    comp(i, num_comp);
    ++num_comp;
  }
  int with_ones = 0;
  for (int i = 0; i < num_comp; ++i) {
    if (has_one[i]) ++with_ones;
  }
  if (with_ones == 0) {
    printf("0\n");
    return 0;
  }
  if (with_ones > 1) {
    printf("-1\n");
    return 0;
  }
  int start = -1;
  for (int i = 0; i < n; ++i) {
    if (has_one[component[i]]) {
      start = i;
      break;
    }
  }
  assert(start >= 0);
  dfs(start, -1, NULL);
  printf("%d\n", k);
  for (int i = 0; i < k; ++i) {
    printf("%d ", path[i] + 1);
  }
  printf("\n");
  return 0;
}
