let arr_of_str s = Array.init (String.length s) (fun i -> s.[i])
let _ = print_endline @@ Scanf.scanf "%s" @@ fun d ->
  let n,w,s,e =
    arr_of_str d |> Array.fold_left (fun (n,w,s,e) c ->
    (n||c='N', w||c='W', s||c='S', e||c='E')) (0=1,0=1,0=1,0=1)
  in if n = s && w = e then "Yes" else "No"
