#import <stdio.h>
int main(){
    int p=0;
    int q=0;
    int r=0;
    int s=0;
    char c;
    while((c=getchar())!=EOF){
        if (c=='N') p++;
        else if (c=='S') q++;
        else if (c=='E') r++;
        else if (c=='W') s++;
        else break;
    }
    puts((p==0&&q>0)||(p>0&&q==0)||(r==0&&s>0)||(r>0&&s==0) ? "No" : "Yes");
}

; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_916/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_916/source.m"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@.str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8

; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
  br label %while.cond.outer

while.cond.outer:                                 ; preds = %if.then9, %entry
  %q.0.ph = phi i32 [ %inc10, %if.then9 ], [ 0, %entry ]
  %r.0.ph = phi i32 [ %r.0.ph61, %if.then9 ], [ 0, %entry ]
  %s.0.ph = phi i32 [ %s.0.ph65, %if.then9 ], [ 0, %entry ]
  %p.0.ph = phi i32 [ %p.0, %if.then9 ], [ 0, %entry ]
  br label %while.cond.outer60

while.cond.outer60:                               ; preds = %while.cond.outer, %if.then15
  %r.0.ph61 = phi i32 [ %r.0.ph, %while.cond.outer ], [ %inc16, %if.then15 ]
  %s.0.ph62 = phi i32 [ %s.0.ph, %while.cond.outer ], [ %s.0.ph65, %if.then15 ]
  %p.0.ph63 = phi i32 [ %p.0.ph, %while.cond.outer ], [ %p.0, %if.then15 ]
  br label %while.cond.outer64

while.cond.outer64:                               ; preds = %while.cond.outer60, %if.then21
  %s.0.ph65 = phi i32 [ %s.0.ph62, %while.cond.outer60 ], [ %inc22, %if.then21 ]
  %p.0.ph66 = phi i32 [ %p.0.ph63, %while.cond.outer60 ], [ %p.0, %if.then21 ]
  br label %while.cond

while.cond:                                       ; preds = %while.cond.outer64, %if.then
  %p.0 = phi i32 [ %inc, %if.then ], [ %p.0.ph66, %while.cond.outer64 ]
  %0 = load ptr, ptr @stdin, align 8, !tbaa !5
  %call.i = tail call i32 @getc(ptr noundef %0)
  %sext = shl i32 %call.i, 24
  switch i32 %sext, label %while.end [
    i32 1459617792, label %if.then21
    i32 1308622848, label %if.then
    i32 1392508928, label %if.then9
    i32 1157627904, label %if.then15
  ]

if.then:                                          ; preds = %while.cond
  %inc = add nsw i32 %p.0, 1
  br label %while.cond

if.then9:                                         ; preds = %while.cond
  %inc10 = add nuw nsw i32 %q.0.ph, 1
  br label %while.cond.outer

if.then15:                                        ; preds = %while.cond
  %inc16 = add nsw i32 %r.0.ph61, 1
  br label %while.cond.outer60

if.then21:                                        ; preds = %while.cond
  %inc22 = add nsw i32 %s.0.ph65, 1
  br label %while.cond.outer64

while.end:                                        ; preds = %while.cond
  %cmp27 = icmp eq i32 %p.0, 0
  %cmp29 = icmp ne i32 %q.0.ph, 0
  %or.cond = select i1 %cmp27, i1 %cmp29, i1 false
  br i1 %or.cond, label %lor.end, label %lor.lhs.false

lor.lhs.false:                                    ; preds = %while.end
  %cmp31 = icmp sgt i32 %p.0, 0
  %cmp34 = icmp eq i32 %q.0.ph, 0
  %or.cond47 = select i1 %cmp31, i1 %cmp34, i1 false
  br i1 %or.cond47, label %lor.end, label %lor.lhs.false36

lor.lhs.false36:                                  ; preds = %lor.lhs.false
  %cmp37 = icmp eq i32 %r.0.ph61, 0
  %cmp40 = icmp sgt i32 %s.0.ph65, 0
  %or.cond48 = select i1 %cmp37, i1 %cmp40, i1 false
  br i1 %or.cond48, label %lor.end, label %lor.rhs

lor.rhs:                                          ; preds = %lor.lhs.false36
  %cmp42 = icmp sgt i32 %r.0.ph61, 0
  %cmp44 = icmp eq i32 %s.0.ph65, 0
  %1 = select i1 %cmp42, i1 %cmp44, i1 false
  %2 = select i1 %1, ptr @.str, ptr @.str.1
  br label %lor.end

lor.end:                                          ; preds = %lor.lhs.false36, %lor.lhs.false, %while.end, %lor.rhs
  %cond = phi ptr [ %2, %lor.rhs ], [ @.str, %while.end ], [ @.str, %lor.lhs.false ], [ @.str, %lor.lhs.false36 ]
  %call46 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1

attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
