TLE '17 Contest 6 P1 - Molecules

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
Fax McClad in his research laboratory.

Fax McClad, Croneria's most scientific bounty hunter, is funding research for more efficient fuel.

There are 26 different types of fuel molecules, labelled from a to z. Two fuel molecules of different types can react to become energy, annihilating the molecules. Thus, a fuel molecule can be a part of at most one reaction.

Fax's scientists have just received a batch of fuel molecules represented by a string S. Is it possible to react all fuel molecules?

Input Specification

The first line of input will contain a single integer, |S| (1 \le |S| \le 10^5), the length of S.

The second line of input will contain S, a string containing only characters a to z, representing fuel molecule types.

Output Specification

Output Yes if all molecules can be reacted, output No otherwise.

Sample Input 1

4
abca

Sample Output 1

Yes

Sample Input 2

4
aaba

Sample Output 2

No

Comments

There are no comments at the moment.