  We study the electron energy spectra of two powerful solar flares
SOL2003-10-28T 11:06:16 (GOES class X17.2) and SOL2002-07-23T00:18:16 (X4.8) on
the basis of HXR and gamma-ray spectra obtained from RHESSI data.
Electron-electron (e-e) bremsstrahlung makes a significant contribution to the
X-ray flux at energies above 500 keV. In X-ray flux calculations different
electron pitch-angle distributions were considered: quasi-transverse and
quasi-longitudinal. It was shown that breaks in hard X-ray spectra occur on
energies $\epsilon\approx100$ keV with photon spectral-index difference
$\Delta\gamma\ge 1$ in the case of quasi-longitudinal anisotropy and hard
power-law electron energy spectra. We deduce the parameters of non-thermal
electrons energy spectra from RHESSI data for the extreme solar flares of 2003
October 28 and 2002 July 23. After including e-e bremsstrahlung, the
non-thermal electrons energy spectra obtained in the thick-target model can be
fitted using power-law with spectral index $\delta\approx 5$. For the 2002 July
23 flare, there is a pronounced asymmetry towards the southern footpoint,
starting from energies above 100 keV. The separation of HXR sources at energies
above 100 keV may be related to a feature of relativistic electron transport in
flaring loops.
