#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 10;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
long long a[MAXN], mark[MAXN];
vector<long long> adj[MAXN], vec, ans;
bool k;
bool dfs(long long v) {
  long long cnt = 0;
  if (a[v] % 2) {
    k = true;
  }
  for (auto u : adj[v]) {
    if (!mark[u]) {
      vec.push_back(v);
      mark[u] = 1;
      cnt++;
      bool d = dfs(u);
      if (!d) {
        vec.push_back(v);
        vec.push_back(u);
        cnt++;
      }
    }
  }
  vec.push_back(v);
  cnt++;
  if (cnt % 2 == a[v] % 2) {
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long v, u;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!mark[i]) {
      mark[i] = 1;
      k = false;
      bool d = dfs(i);
      if (k) {
        cnt++;
        if (cnt > 1) {
          cout << -1;
          return 0;
        }
        if (!d) {
          vec.pop_back();
        }
        for (auto u : vec) {
          ans.push_back(u);
        }
      }
      while (vec.size()) {
        vec.pop_back();
      }
    }
  }
  cout << ans.size() << '\n';
  for (auto u : ans) {
    cout << u << " ";
  }
}
