This question asks the hearer to name/identify something. It is not to be answered with はい or いいえ. The original form of なん is なに, which is the question word for "what". なん is used when preceding です. In Japanese, a question word is not necessarily placed at the beginning of an interrogative sentence.
A: あれは なんですか。
What is that [over there]?
B: あれは スカーフです。ハンカチでは ありません。
That's a scarf. It's not a handkerchief.