function [ys,check] = yyc_steadystate(ys,~)
% 
% Inputs: 
%   - ys        [vector] vector of initial values for the steady state of
%                   the endogenous variables
%   - exo       [vector] vector of values for the exogenous variables
%
% Output: 
%   - ys        [vector] vector of steady state values fpr the the endogenous variables
%   - check     [scalar] set to 0 if steady state computation worked and to
%                    1 of not (allows to impos restriction on parameters)
%


global M_ 


% read out parameters to access them with their name
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
  paramname = deblank(M_.param_names(ii,:));
  eval([ paramname ' = M_.params(' int2str(ii) ');']);
end
% initialize indicator
check = 0;




%% Enter model equations here


options=optimset('MaxFunEvals', 10000, 'MaxIter',10000); % set options for numerical solver
zg = ones(15,1);%starting value
[z,~,exitflag]=fsolve(@myfct,zg,options); 
if exitflag<1
    check=1;
end
M = z(1);
c = z(2);
B = z(3);
w = z(4);
L = z(5);
qm = z(6);
q = z(7);
gamma_f = z(8);
gamma_h = z(9);
Bf = z(10);
e = z(11);
gamma = z(12);
GDP = z(13);
P = z(14);
Bf_p = z(15);
ca = 0; % based on eq.(17) on paper.
pi = 1;
g = 1;
Xstar=1;
psi = psi_bar;
R =1/beta;
Rf =1/beta;

%% end own model equations


for iter = 1:length(M_.params) %update parameters set in the file
  eval([ 'M_.params(' num2str(iter) ') = ' M_.param_names(iter,:) ';' ])
end


NumberOfEndogenousVariables = M_.orig_endo_nbr; %auxiliary variables are set automatically
for ii = 1:NumberOfEndogenousVariables
  varname = deblank(M_.endo_names(ii,:));
  eval(['ys(' int2str(ii) ') = ' varname ';']);
end