#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 10;
int n, m;
vector<int> num[maxn], ans;
bool mod[maxn], now[maxn], visited[maxn];
bool good(int t) { return now[t] == mod[t]; }
void dfs(int v, int pr) {
  visited[v] = true;
  ans.push_back(v);
  now[v] ^= 1;
  for (int i = 0; i < (num[v].size()); i++) {
    if (!visited[num[v][i]]) {
      dfs(num[v][i], v);
      ans.push_back(v);
      now[v] ^= 1;
    }
  }
  if (!good(v) && pr != -1) {
    ans.push_back(pr);
    ans.push_back(v);
    now[pr] ^= 1;
    now[v] ^= 1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    num[a].push_back(b);
    num[b].push_back(a);
  }
  for (int i = 1; i < n + 1; i++) cin >> mod[i];
  int start = -1;
  for (int i = 1; i < n + 1; i++) {
    if (mod[i]) {
      start = i;
      break;
    }
  }
  if (start == -1) {
    cout << 0;
    return 0;
  }
  dfs(start, -1);
  int id = !good(start);
  for (int i = 1; i < n + 1; i++) {
    if (!good(i) && i != start) {
      cout << -1;
      return 0;
    }
  }
  cout << ans.size() - id << endl;
  for (int i = id; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
}
