#include <bits/stdc++.h>
using namespace std;
int n, m, x, y;
int pai[100010];
vector<int> adj[100010];
int v[100010];
vector<int> answ;
int vis[100010];
int find(int x) {
  if (x == pai[x]) return x;
  return pai[x] = find(pai[x]);
}
bool unio(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return false;
  pai[x] = y;
  return true;
}
void dfs(int curr, int p, int root) {
  vis[curr] = 1;
  answ.push_back(curr);
  for (int i = 0; i < adj[curr].size(); ++i) {
    int u = adj[curr][i];
    if (u != p) {
      dfs(u, curr, root);
      if (curr != root) {
        answ.push_back(curr);
        vis[curr]++;
      } else {
        if (vis[u] % 2 != v[u] || i != adj[curr].size() - 1 ||
            vis[curr] % 2 != v[curr]) {
          answ.push_back(curr);
          vis[curr]++;
        }
      }
      if (vis[u] % 2 != v[u]) {
        answ.push_back(u);
        vis[u]++;
        if (curr != root) {
          answ.push_back(curr);
          vis[curr]++;
        } else {
          if (i != adj[curr].size() - 1 || vis[curr] % 2 != v[curr]) {
            answ.push_back(curr);
            vis[curr]++;
          }
        }
      }
    }
  }
}
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 0; i <= n; ++i) pai[i] = i;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &x, &y);
    if (unio(x, y)) {
      adj[x].push_back(y);
      adj[y].push_back(x);
    }
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &v[i]);
  }
  bool ok = false;
  for (int i = 1; i <= n; ++i) {
    if (!vis[i] && v[i] && !ok) {
      dfs(i, -1, i);
      ok = true;
    } else if (!vis[i] && v[i] && ok) {
      printf("-1\n");
      return 0;
    }
  }
  printf("%d\n", answ.size());
  for (int i = 0; i < answ.size(); ++i) {
    printf("%d", answ[i]);
    if (i == answ.size() - 1) {
      printf("\n");
    } else
      printf(" ");
  }
  return 0;
}
