In the html code of the page main menu site is presented in a tree view like this:
ul > li > a
ul > li > ul > li
etc. at any level of nesting
After the page is loaded the JS code scans this menu and turns it into a menu, which is administered only the first level, and the rest appear only when clicking on the corresponding items.
Normally Yandex will index or will think that the page is illegal JS-activity with the forgery of the HTML elements?