EX-23 2 ex23.txt INDEPENDENT AUDITOR'S CONSENT Exhibit 23 CONSENT OF INDEPENDENT REGISTED PUBLIC ACCOUNTING FIRM We consent to the incorporation by reference in Registration Statement No. 333-79979 of National Bankshares, Inc. on Form S-8 of our report, dated February 23, 2005, relating to the consolidated balance sheets of National Bankshares, Inc and subsidiaries as of December 31, 2004 and 2003, and the related consolidated statements of income, changes in stockholders' equity and cash flows for the years ended December 31, 2004, 2003 and 2002 appearing in this Annual Report on Form 10-K of National Bankshares, Inc. for the year ended December 31, 2004. /s/ Yount, Hyde & Barbour, P.C. --------------------------------- Winchester, Virginia March 10, 2005