#include <bits/stdc++.h>
using namespace std;
const long long MX = 1e5 + 9;
bool stt[MX], mrk[MX];
vector<long long> adj[MX], ans;
long long st = 0;
void DFS(long long u, long long root) {
  ans.push_back(u);
  mrk[u] = 1;
  stt[u] ^= 1;
  for (long long v : adj[u])
    if (!mrk[v]) {
      DFS(v, root);
      ans.push_back(u);
      stt[u] ^= 1;
      if (stt[v]) {
        stt[v] ^= 1;
        stt[u] ^= 1;
        ans.push_back(v);
        ans.push_back(u);
      }
    }
  if (stt[u] && u == root) st = 1, stt[u] = 0;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) cin >> stt[i];
  for (long long i = 1; i <= n; i++)
    if (stt[i]) {
      DFS(i, i);
      break;
    }
  for (long long i = 1; i <= n; i++)
    if (stt[i]) return cout << -1, 0;
  cout << ans.size() - st << endl;
  for (long long i = st; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
