EX-23 2 ex23.txt CONSENT OF INDEPENDENT AUDITORS Exhibit 23 CONSENT OF INDEPENDENT REGISTED PUBLIC ACCOUNTING FIRM We consent to the incorporation by reference in Registration Statement No. 333-79979 on Form S-8 of National Bankshares, Inc. of our report dated February 9, 2006 relating to our audits of the consolidated financial statements and internal control over financial reporting, which appear in this Annual Report on Form 10-K of National Bankshares, Inc. for the year ended December 31, 2005. /s/ Yount, Hyde & Barbour, P.C. Winchester, Virginia March 14, 2006